From 88a50ffa715483e7187c0d7d6caaf708ebacf756 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 29 Mar 2024 15:10:50 -0300 Subject: Fixed dangling 'StkId' in 'luaV_finishget' Bug introduced in 05932567. --- lvm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lvm.c') diff --git a/lvm.c b/lvm.c index cfa9961b..37023afb 100644 --- a/lvm.c +++ b/lvm.c @@ -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; \ -- cgit v1.2.3-55-g6feb