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

Bounds checking code can overflow #9020

Closed
Thiez opened this issue Sep 6, 2013 · 1 comment
Closed

Bounds checking code can overflow #9020

Thiez opened this issue Sep 6, 2013 · 1 comment
Labels
I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

Comments

@Thiez
Copy link
Contributor

Thiez commented Sep 6, 2013

When using very large indices, the bounds checking code fails. Example:

let x = [0i32, ..16];
assert_eq(x[1u << 63],0);
assert_eq(&x[0], &x[1u << 63]);

Both asserts pass on a 64 bit system.

@thestinger
Copy link
Contributor

It should compare/store element length rather than byte length.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Projects
None yet
Development

No branches or pull requests

2 participants