Fixed dangling 'StkId' in 'luaV_finishget'

Bug introduced in 05932567.
This commit is contained in:
Roberto Ierusalimschy
2024-03-29 15:10:50 -03:00
parent 86a8e74824
commit 88a50ffa71
5 changed files with 42 additions and 26 deletions

10
lvm.c
View File

@@ -308,8 +308,8 @@ int luaV_finishget (lua_State *L, const TValue *t, TValue *key, StkId val,
/* else will try the metamethod */
}
if (ttisfunction(tm)) { /* is metamethod a function? */
luaT_callTMres(L, tm, t, key, val); /* call it */
return ttypetag(s2v(val));
tag = luaT_callTMres(L, tm, t, key, val); /* call it */
return tag; /* return tag of the result */
}
t = tm; /* else try to access 'tm[key]' */
luaV_fastget(t, key, s2v(val), luaH_get, tag);
@@ -606,8 +606,8 @@ int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2) {
if (tm == NULL) /* no TM? */
return 0; /* objects are different */
else {
luaT_callTMres(L, tm, t1, t2, L->top.p); /* call TM */
return !l_isfalse(s2v(L->top.p));
int tag = luaT_callTMres(L, tm, t1, t2, L->top.p); /* call TM */
return !tagisfalse(tag);
}
}
@@ -914,7 +914,7 @@ void luaV_finishOp (lua_State *L) {
/*
** Auxiliary function for arithmetic operations over floats and others
** with two register operands.
** with two operands.
*/
#define op_arithf_aux(L,v1,v2,fop) { \
lua_Number n1; lua_Number n2; \