Skip to content

Right shift of 128-bit wide integer by zero produces incorrect results #13

Open
@gnzlbg

Description

@gnzlbg

This test passes on s390x-unknown-linux-gnu and sparc64-unknown-linux-gnu (it does not panic):

#[test]
pub fn scalar_test() {
    let z = 0_i128;
    let o = 1_i128;

    if o >> z != o {
        panic!();
    }
}

The same applies to vectors containing i128 like i128x1 and i128x2.

Reported upstream: rust-lang/rust#52015

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-Sparc64SPARC64 architectureA-SystemZz architectureBlocked-RustIssues blocked on rust-lang/rustUnsoundSomething breaks Rust safety guarantees

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions