diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2022-09-23 11:08:10 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2022-09-23 11:08:10 -0300 |
commit | 26be27459b11feabed52cf40aaa76f86c7edc977 (patch) | |
tree | 9f3cd8be898991a52f6b5f8b140a12b8b9acb51d /lvm.c | |
parent | cfbe378f906061ee56f91acfbdf569d0d3fb9556 (diff) | |
download | lua-26be27459b11feabed52cf40aaa76f86c7edc977.tar.gz lua-26be27459b11feabed52cf40aaa76f86c7edc977.tar.bz2 lua-26be27459b11feabed52cf40aaa76f86c7edc977.zip |
Negation in constant folding of '>>' may overflow
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -765,12 +765,10 @@ lua_Number luaV_modf (lua_State *L, lua_Number m, lua_Number n) { | |||
765 | /* number of bits in an integer */ | 765 | /* number of bits in an integer */ |
766 | #define NBITS cast_int(sizeof(lua_Integer) * CHAR_BIT) | 766 | #define NBITS cast_int(sizeof(lua_Integer) * CHAR_BIT) |
767 | 767 | ||
768 | |||
768 | /* | 769 | /* |
769 | ** Shift left operation. (Shift right just negates 'y'.) | 770 | ** Shift left operation. (Shift right just negates 'y'.) |
770 | */ | 771 | */ |
771 | #define luaV_shiftr(x,y) luaV_shiftl(x,intop(-, 0, y)) | ||
772 | |||
773 | |||
774 | lua_Integer luaV_shiftl (lua_Integer x, lua_Integer y) { | 772 | lua_Integer luaV_shiftl (lua_Integer x, lua_Integer y) { |
775 | if (y < 0) { /* shift right? */ | 773 | if (y < 0) { /* shift right? */ |
776 | if (y <= -NBITS) return 0; | 774 | if (y <= -NBITS) return 0; |