diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-03-21 11:23:21 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-03-21 11:23:21 -0300 |
commit | 0593256707ceddb1bc9cd4b25b822a7fbcfedd66 (patch) | |
tree | 6c6859b94086b71b27409b565ed34c114f03e7f8 /ltests.c | |
parent | ce6f5502c99ce9a367e25b678e375db6f8164d73 (diff) | |
download | lua-0593256707ceddb1bc9cd4b25b822a7fbcfedd66.tar.gz lua-0593256707ceddb1bc9cd4b25b822a7fbcfedd66.tar.bz2 lua-0593256707ceddb1bc9cd4b25b822a7fbcfedd66.zip |
'luaH_get' functions return tag of the result
Undoing previous commit. Returning TValue increases code size without
any visible gains. Returning the tag is a little simpler than returning
a special code (HOK/HNOTFOUND) and the tag is useful by itself in
some cases.
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1538,7 +1538,8 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) { | |||
1538 | } | 1538 | } |
1539 | else if EQ("getfield") { | 1539 | else if EQ("getfield") { |
1540 | int t = getindex; | 1540 | int t = getindex; |
1541 | lua_getfield(L1, t, getstring); | 1541 | int tp = lua_getfield(L1, t, getstring); |
1542 | lua_assert(tp == lua_type(L1, -1)); | ||
1542 | } | 1543 | } |
1543 | else if EQ("getglobal") { | 1544 | else if EQ("getglobal") { |
1544 | lua_getglobal(L1, getstring); | 1545 | lua_getglobal(L1, getstring); |
@@ -1548,7 +1549,8 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) { | |||
1548 | lua_pushnil(L1); | 1549 | lua_pushnil(L1); |
1549 | } | 1550 | } |
1550 | else if EQ("gettable") { | 1551 | else if EQ("gettable") { |
1551 | lua_gettable(L1, getindex); | 1552 | int tp = lua_gettable(L1, getindex); |
1553 | lua_assert(tp == lua_type(L1, -1)); | ||
1552 | } | 1554 | } |
1553 | else if EQ("gettop") { | 1555 | else if EQ("gettop") { |
1554 | lua_pushinteger(L1, lua_gettop(L1)); | 1556 | lua_pushinteger(L1, lua_gettop(L1)); |