From 26be27459b11feabed52cf40aaa76f86c7edc977 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 23 Sep 2022 11:08:10 -0300 Subject: Negation in constant folding of '>>' may overflow --- lobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lobject.c') diff --git a/lobject.c b/lobject.c index a2c00609..03e2798c 100644 --- a/lobject.c +++ b/lobject.c @@ -62,7 +62,7 @@ static lua_Integer intarith (lua_State *L, int op, lua_Integer v1, case LUA_OPBOR: return intop(|, v1, v2); case LUA_OPBXOR: return intop(^, v1, v2); case LUA_OPSHL: return luaV_shiftl(v1, v2); - case LUA_OPSHR: return luaV_shiftl(v1, -v2); + case LUA_OPSHR: return luaV_shiftr(v1, v2); case LUA_OPUNM: return intop(-, 0, v1); case LUA_OPBNOT: return intop(^, ~l_castS2U(0), v1); default: lua_assert(0); return 0; -- cgit v1.2.3-55-g6feb