-
-
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
example use of @inbounds in the @inbounds documentation uses it incorrectly #39367
Labels
docs
This change adds or pertains to documentation
Comments
yurivish
changed the title
the example use of @inbounds in the documentation for @inbounds not a correct use of @inbounds
example use of @inbounds in the @inbounds documentation uses it incorrectly
Jan 23, 2021
mbauman
added a commit
that referenced
this issue
Jan 23, 2021
ElOceanografo
pushed a commit
to ElOceanografo/julia
that referenced
this issue
May 4, 2021
antoine-levitt
pushed a commit
to antoine-levitt/julia
that referenced
this issue
May 9, 2021
KristofferC
pushed a commit
that referenced
this issue
Jun 3, 2022
KristofferC
pushed a commit
that referenced
this issue
Jul 4, 2022
KristofferC
pushed a commit
that referenced
this issue
Dec 21, 2022
staticfloat
pushed a commit
that referenced
this issue
Dec 23, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It appears that the example use of
@inbounds
given in the documentation for@inbounds
is not a safe use of@inbounds
:The paragraph above the example implies that it is meant as an example to be followed, not one to be avoided. However, the warning immediately below the example strongly recommends only using
@inbounds
when it is certain from the information locally available that all accesses are in bounds.This is not the case in the example, whose method signature explicitly allows all
AbstractArray
s, including those which do not use one-based indexing.I verified that the example silently produces incorrect results due to out-of-bounds memory access on Julia 1.5.3:
The text was updated successfully, but these errors were encountered: