'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.
This commit is contained in:
Roberto Ierusalimschy
2024-03-21 11:23:21 -03:00
parent ce6f5502c9
commit 0593256707
10 changed files with 139 additions and 133 deletions

View File

@@ -1538,7 +1538,8 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) {
}
else if EQ("getfield") {
int t = getindex;
lua_getfield(L1, t, getstring);
int tp = lua_getfield(L1, t, getstring);
lua_assert(tp == lua_type(L1, -1));
}
else if EQ("getglobal") {
lua_getglobal(L1, getstring);
@@ -1548,7 +1549,8 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) {
lua_pushnil(L1);
}
else if EQ("gettable") {
lua_gettable(L1, getindex);
int tp = lua_gettable(L1, getindex);
lua_assert(tp == lua_type(L1, -1));
}
else if EQ("gettop") {
lua_pushinteger(L1, lua_gettop(L1));