Make sure conversion of signed ints before shift applies to the shifted number

This commit is contained in:
Ayaz Hafiz 2022-10-04 14:23:53 -05:00
parent a08b45263b
commit 29991654db
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -1686,7 +1686,7 @@ impl<'a> LowLevelCall<'a> {
let bit_width = 8 * self
.ret_layout
.stack_size(backend.env.layout_interner, TARGET_INFO);
if bit_width < 32 && symbol_is_signed_int(backend, bits) {
if bit_width < 32 && symbol_is_signed_int(backend, num) {
let mask = (1 << bit_width) - 1;
backend