diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-03-07 13:19:00 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-03-07 13:19:00 -0300 |
| commit | cd12410195e092f966db2c9e524c2cd5fd09fa1a (patch) | |
| tree | 5c7eb74fe79df2cb5fb65969bfc0fda23a11d9e6 /lcode.c | |
| parent | c5bb3643ab28d5309971f1960dd5222b9c81fd3a (diff) | |
| download | lua-cd12410195e092f966db2c9e524c2cd5fd09fa1a.tar.gz lua-cd12410195e092f966db2c9e524c2cd5fd09fa1a.tar.bz2 lua-cd12410195e092f966db2c9e524c2cd5fd09fa1a.zip | |
new macro 'cast_void'
Diffstat (limited to 'lcode.c')
| -rw-r--r-- | lcode.c | 7 |
1 files changed, 4 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lcode.c,v 2.81 2014/03/06 13:58:28 roberto Exp roberto $ | 2 | ** $Id: lcode.c,v 2.82 2014/03/06 16:15:18 roberto Exp roberto $ |
| 3 | ** Code generator for Lua | 3 | ** Code generator for Lua |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -756,8 +756,9 @@ void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) { | |||
| 756 | static int validop (OpCode op, TValue *v1, TValue *v2) { | 756 | static int validop (OpCode op, TValue *v1, TValue *v2) { |
| 757 | lua_Number a, b; | 757 | lua_Number a, b; |
| 758 | lua_Integer i; | 758 | lua_Integer i; |
| 759 | (void)a; (void)b; /* macro may not use its arguments */ | 759 | cast_void(a); cast_void(b); /* macro may not use its arguments */ |
| 760 | if (luai_numinvalidop(op, (tonumber(v1, &a), a), (tonumber(v2, &b), b))) | 760 | if (luai_numinvalidop(op, (cast_void(tonumber(v1, &a)), a), |
| 761 | (cast_void(tonumber(v2, &b)), b))) | ||
| 761 | return 0; | 762 | return 0; |
| 762 | switch (op) { | 763 | switch (op) { |
| 763 | case LUA_OPIDIV: /* division by 0 and conversion errors */ | 764 | case LUA_OPIDIV: /* division by 0 and conversion errors */ |
