mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-11-27 08:10:07 +08:00
BR 3392442: correct vmin in overflow_general()
The calculation of vmin in overflow_general() was bogus, causing silliness like ~80h being warned about in a byte context. Reported-by: C. Masloch <pushbx@38.de> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
This commit is contained in:
parent
9e08075278
commit
aaefc7fe6b
@ -461,7 +461,7 @@ static inline bool const_func overflow_general(int64_t value, int bytes)
|
||||
|
||||
sbit = (bytes << 3) - 1;
|
||||
vmax = ((int64_t)2 << sbit) - 1;
|
||||
vmin = -((int64_t)1 << sbit);
|
||||
vmin = -((int64_t)2 << sbit);
|
||||
|
||||
return value < vmin || value > vmax;
|
||||
}
|
||||
|
6
test/br3392442.asm
Normal file
6
test/br3392442.asm
Normal file
@ -0,0 +1,6 @@
|
||||
;; Bug report 3392442: invalid warning
|
||||
|
||||
and byte [0], ~80h
|
||||
and byte [0], 0xfff
|
||||
and byte [0], -256
|
||||
and byte [0], -257
|
Loading…
Reference in New Issue
Block a user