-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Open
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.miscompilationThe compiler reports success but produces semantically incorrect code.The compiler reports success but produces semantically incorrect code.
Milestone
Description
pub const panic = @import("std").debug.no_panic;
var lhs: u3 = 1;
var rhs: u1 = 0;
export fn shlSat() void {
lhs <<|= rhs;
}
$ zig build-obj repro.zig --verbose-air |& grep cmp_lt
%4 = cmp_lt(%3, <u1, 3>)
This safety check only applies to <<
, not <<|
.
As an added bonus for fixing this bug, you can enable the disabled safety checks in test/behavior/bit_shifting.zig
and test/behavior/x86_64/binary.zig
referencing this issue!
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.miscompilationThe compiler reports success but produces semantically incorrect code.The compiler reports success but produces semantically incorrect code.