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

Array indexes can overflow in some situations #2470

Closed
msullivan opened this issue May 31, 2012 · 3 comments
Closed

Array indexes can overflow in some situations #2470

msullivan opened this issue May 31, 2012 · 3 comments
Labels
A-codegen Area: Code generation

Comments

@msullivan
Copy link
Contributor

In some situations, array indexes that should be out of bounds may overflow to in bounds array indexes. This can happen due if the index type is wider than the platform int size and gets truncated or if the multiplication by the element size overflows.

@ghost ghost assigned msullivan May 31, 2012
@eholk
Copy link
Contributor

eholk commented May 31, 2012

What's the failure mode here? Does it just crash with an array out of bounds error? If so, that doesn't seem unreasonable to me.

@msullivan
Copy link
Contributor Author

No, the failure mode is that it will successfully index into the array at a wrapped around index, which is almost certainly not what we want.

@ghost ghost assigned mozmark Jun 6, 2012
graydon added a commit that referenced this issue Jun 6, 2012
graydon added a commit that referenced this issue Jun 7, 2012
@catamorphism
Copy link
Contributor

Seems to me like an instance of a much more general problem, so I opened #6012 and am closing this.

bors added a commit to rust-lang-ci/rust that referenced this issue Sep 22, 2022
support current_exe and home_dir on macOS

also fix write_os_str length logic
celinval added a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
Remove `--test` and add trailing test arguments to allow us to pass extra arguments to the test binary.

Co-authored-by: Jaisurya Nanduri <91620234+jaisnan@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation
Projects
None yet
Development

No branches or pull requests

4 participants