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

Minor issue explaining "Undefined Behavior" (offset of out-of-bound access) #55

Open
IgorDzreyev opened this issue Jun 4, 2024 · 0 comments

Comments

@IgorDzreyev
Copy link

Type of error

Minor technical mistake

Location of the error

https://marabos.nl/atomics/basics.html

Description of the error

Minor issue in explaing code for "Undefined Behavior ":

let a = [123, 456, 789];
let b = unsafe { a.get_unchecked(index) };

... It [access] might result in reading from memory whatever was stored in the bytes right after a. ...

Looks like it is 3 * size of i32 (12) bytes after a ...

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

No branches or pull requests

1 participant