zig icon indicating copy to clipboard operation
zig copied to clipboard

stage2: `@shlExact` and `@shrExact` crashes the compiler when the first argument is a comptime_int and the second is runtime known

Open tauoverpi opened this issue 3 years ago • 0 comments

Zig Version

0.10.0-dev.3361+c650ccfca

Steps to Reproduce

Run the following with zig test -fno-stage1 shl.zig

test {
    var x: u5 = 1;
    _ = @shlExact(12345, x);
    _ = @shrExact(12345, x);
}

Expected Behavior

Compiles without error.

Actual Behavior

> zig test -fno-stage1 shl.zig
fish: Job 1, 'zig test -fno-stage1 shl.zig' terminated by signal SIGTRAP (Trace or breakpoint trap)

tauoverpi avatar Jul 29 '22 15:07 tauoverpi