Skip to content

Bounds checking code can overflow #9020

Closed
@Thiez

Description

@Thiez

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions