issue #222 Lua 5.4 change for bitwise ops

master
Dibyendu Majumdar 3 years ago
parent d5e324fd53
commit 3efaddee6b

@ -164,8 +164,7 @@ void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2,
/* call never returns, but to avoid warnings: *//* FALLTHROUGH */
case TM_BAND: case TM_BOR: case TM_BXOR:
case TM_SHL: case TM_SHR: case TM_BNOT: {
lua_Number dummy;
if (tonumber(p1, &dummy) && tonumber(p2, &dummy))
if (ttisnumber(p1) && ttisnumber(p2))
luaG_tointerror(L, p1, p2);
else
luaG_opinterror(L, p1, p2, "perform bitwise operation on");

Loading…
Cancel
Save