Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

searchsorted segfaults with offset arrays #33977

Closed
dlfivefifty opened this issue Nov 28, 2019 · 0 comments · Fixed by #34106
Closed

searchsorted segfaults with offset arrays #33977

dlfivefifty opened this issue Nov 28, 2019 · 0 comments · Fixed by #34106

Comments

@dlfivefifty
Copy link
Contributor

julia> using OffsetArrays

julia> o = OffsetArray([2,2,3],-1:1)
3-element OffsetArray(::Array{Int64,1}, -1:1) with eltype Int64 with indices -1:1:
 
2
 2
 3

julia> searchsorted(o,1)
Segmentation fault: 11

This is due to

julia> (-2) >>> 1
9223372036854775807

which triggers:

m = (lo + hi) >>> 1

Crossref JuliaArrays/OffsetArrays.jl#85

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant