aboutsummaryrefslogtreecommitdiff
path: root/lvm.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2022-09-23 11:08:10 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2022-09-23 11:08:10 -0300
commit26be27459b11feabed52cf40aaa76f86c7edc977 (patch)
tree9f3cd8be898991a52f6b5f8b140a12b8b9acb51d /lvm.c
parentcfbe378f906061ee56f91acfbdf569d0d3fb9556 (diff)
downloadlua-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.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lvm.c b/lvm.c
index 614df055..73a19ba9 100644
--- a/lvm.c
+++ b/lvm.c
@@ -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
774lua_Integer luaV_shiftl (lua_Integer x, lua_Integer y) { 772lua_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;