To reproduce:
❯ cat test/overflow.bril
@main() {
x: int = const 9223372036854775807;
one: int = const 1;
three: int = const 3;
y: int = add x one;
print y;
y: int = mul x three;
print y;
}
❯
❯ bril2json < test/overflow.bril | brili
-9223372036854775807
-9223372036854775808
❯ bril2json < test/overflow.bril | brilirs
-9223372036854775808
9223372036854775805
❯
The Bril documentation on integers writes:
int: 64-bit, two’s complement, signed integers.
I wonder which one is correct?