-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 has an errant @inbounds
#51176
Comments
This is expected behavior. |
Ideally, this shouldn't be the expected behavior, and the compiler, being able to prove that the indices are within bounds, should use inbounds without an explicit annotation |
This should error:
When we run Julia with
check-bounds = yes
we get correct behaviour:The problem applies to other searchsorted variants.
There should probably be a check on whether
hi
exceeds the length of a vector injulia/base/sort.jl
Line 195 in 8e14322
The text was updated successfully, but these errors were encountered: