diff options
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 2.190 2014/03/15 12:29:48 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.191 2014/03/31 18:37:52 roberto Exp roberto $ |
3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -325,7 +325,7 @@ void luaV_objlen (lua_State *L, StkId ra, const TValue *rb) { | |||
325 | 325 | ||
326 | 326 | ||
327 | lua_Integer luaV_div (lua_State *L, lua_Integer x, lua_Integer y) { | 327 | lua_Integer luaV_div (lua_State *L, lua_Integer x, lua_Integer y) { |
328 | if (cast_unsigned(y) + 1 <= 1U) { /* special cases: -1 or 0 */ | 328 | if (cast_unsigned(y) + 1 <= 1u) { /* special cases: -1 or 0 */ |
329 | if (y == 0) | 329 | if (y == 0) |
330 | luaG_runerror(L, "attempt to divide by zero"); | 330 | luaG_runerror(L, "attempt to divide by zero"); |
331 | return intop(-, 0, x); /* y==-1; avoid overflow with 0x80000...//-1 */ | 331 | return intop(-, 0, x); /* y==-1; avoid overflow with 0x80000...//-1 */ |
@@ -341,7 +341,7 @@ lua_Integer luaV_div (lua_State *L, lua_Integer x, lua_Integer y) { | |||
341 | 341 | ||
342 | 342 | ||
343 | lua_Integer luaV_mod (lua_State *L, lua_Integer x, lua_Integer y) { | 343 | lua_Integer luaV_mod (lua_State *L, lua_Integer x, lua_Integer y) { |
344 | if (cast_unsigned(y) + 1 <= 1U) { /* special cases: -1 or 0 */ | 344 | if (cast_unsigned(y) + 1 <= 1u) { /* special cases: -1 or 0 */ |
345 | if (y == 0) | 345 | if (y == 0) |
346 | luaG_runerror(L, "attempt to perform 'n%%0'"); | 346 | luaG_runerror(L, "attempt to perform 'n%%0'"); |
347 | return 0; /* y==-1; avoid overflow with 0x80000...%-1 */ | 347 | return 0; /* y==-1; avoid overflow with 0x80000...%-1 */ |