diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-06-01 17:22:33 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-06-01 17:22:33 -0300 |
commit | b029e7ea2070b834e1061492367faa11a1d54e3c (patch) | |
tree | ee1e411a0e05e34273ecf20dd5c0a203c081be56 /lapi.c | |
parent | 4bc33d64de9bb2c1cd96240337ba8486300759da (diff) | |
download | lua-b029e7ea2070b834e1061492367faa11a1d54e3c.tar.gz lua-b029e7ea2070b834e1061492367faa11a1d54e3c.tar.bz2 lua-b029e7ea2070b834e1061492367faa11a1d54e3c.zip |
macro 'luaV_fastget' may need protection ({}) to be used inside
'if's
Diffstat (limited to 'lapi.c')
-rw-r--r-- | lapi.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 2.267 2017/05/18 12:34:58 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.268 2017/05/26 19:14:29 roberto Exp roberto $ |
3 | ** Lua API | 3 | ** Lua API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -775,8 +775,9 @@ LUA_API void lua_settable (lua_State *L, int idx) { | |||
775 | lua_lock(L); | 775 | lua_lock(L); |
776 | api_checknelems(L, 2); | 776 | api_checknelems(L, 2); |
777 | t = index2addr(L, idx); | 777 | t = index2addr(L, idx); |
778 | if (luaV_fastget(L, t, L->top - 2, slot, luaH_get)) | 778 | if (luaV_fastget(L, t, L->top - 2, slot, luaH_get)) { |
779 | luaV_finishfastset(L, t, slot, L->top - 1); | 779 | luaV_finishfastset(L, t, slot, L->top - 1); |
780 | } | ||
780 | else | 781 | else |
781 | luaV_finishset(L, t, L->top - 2, L->top - 1, slot); | 782 | luaV_finishset(L, t, L->top - 2, L->top - 1, slot); |
782 | L->top -= 2; /* pop index and value */ | 783 | L->top -= 2; /* pop index and value */ |
@@ -796,8 +797,9 @@ LUA_API void lua_seti (lua_State *L, int idx, lua_Integer n) { | |||
796 | lua_lock(L); | 797 | lua_lock(L); |
797 | api_checknelems(L, 1); | 798 | api_checknelems(L, 1); |
798 | t = index2addr(L, idx); | 799 | t = index2addr(L, idx); |
799 | if (luaV_fastgeti(L, t, n, slot)) | 800 | if (luaV_fastgeti(L, t, n, slot)) { |
800 | luaV_finishfastset(L, t, slot, L->top - 1); | 801 | luaV_finishfastset(L, t, slot, L->top - 1); |
802 | } | ||
801 | else { | 803 | else { |
802 | TValue aux; | 804 | TValue aux; |
803 | setivalue(&aux, n); | 805 | setivalue(&aux, n); |