Bug: Negation in 'luaV_shiftr' may overflow

Negation of an unchecked lua_Integer overflows with mininteger.
This commit is contained in:
Roberto Ierusalimschy committed 2021-07-22 13:44:53 -03:00
1 parent 8a32e0aa4a
commit 62fb934427
2 files changed
+6 -1

No files matched your search

+5
View File
@@ -45,6 +45,11 @@ assert(-1 >> numbits == 0 and
-1 << numbits == 0 and
-1 << -numbits == 0)
assert(1 >> math.mininteger == 0)
assert(1 >> math.maxinteger == 0)
assert(1 << math.mininteger == 0)
assert(1 << math.maxinteger == 0)
assert((2^30 - 1) << 2^30 == 0)
assert((2^30 - 1) >> 2^30 == 0)