diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-03-29 15:10:50 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-03-29 15:10:50 -0300 |
commit | 88a50ffa715483e7187c0d7d6caaf708ebacf756 (patch) | |
tree | abd032613bb066ebf4b4d3d2cb2e031347945c0a /lvm.c | |
parent | 86a8e74824b3ec7918e3dbeaff222bb1ea1ec22f (diff) | |
download | lua-88a50ffa715483e7187c0d7d6caaf708ebacf756.tar.gz lua-88a50ffa715483e7187c0d7d6caaf708ebacf756.tar.bz2 lua-88a50ffa715483e7187c0d7d6caaf708ebacf756.zip |
Fixed dangling 'StkId' in 'luaV_finishget'
Bug introduced in 05932567.
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -308,8 +308,8 @@ int luaV_finishget (lua_State *L, const TValue *t, TValue *key, StkId val, | |||
308 | /* else will try the metamethod */ | 308 | /* else will try the metamethod */ |
309 | } | 309 | } |
310 | if (ttisfunction(tm)) { /* is metamethod a function? */ | 310 | if (ttisfunction(tm)) { /* is metamethod a function? */ |
311 | luaT_callTMres(L, tm, t, key, val); /* call it */ | 311 | tag = luaT_callTMres(L, tm, t, key, val); /* call it */ |
312 | return ttypetag(s2v(val)); | 312 | return tag; /* return tag of the result */ |
313 | } | 313 | } |
314 | t = tm; /* else try to access 'tm[key]' */ | 314 | t = tm; /* else try to access 'tm[key]' */ |
315 | luaV_fastget(t, key, s2v(val), luaH_get, tag); | 315 | 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) { | |||
606 | if (tm == NULL) /* no TM? */ | 606 | if (tm == NULL) /* no TM? */ |
607 | return 0; /* objects are different */ | 607 | return 0; /* objects are different */ |
608 | else { | 608 | else { |
609 | luaT_callTMres(L, tm, t1, t2, L->top.p); /* call TM */ | 609 | int tag = luaT_callTMres(L, tm, t1, t2, L->top.p); /* call TM */ |
610 | return !l_isfalse(s2v(L->top.p)); | 610 | return !tagisfalse(tag); |
611 | } | 611 | } |
612 | } | 612 | } |
613 | 613 | ||
@@ -914,7 +914,7 @@ void luaV_finishOp (lua_State *L) { | |||
914 | 914 | ||
915 | /* | 915 | /* |
916 | ** Auxiliary function for arithmetic operations over floats and others | 916 | ** Auxiliary function for arithmetic operations over floats and others |
917 | ** with two register operands. | 917 | ** with two operands. |
918 | */ | 918 | */ |
919 | #define op_arithf_aux(L,v1,v2,fop) { \ | 919 | #define op_arithf_aux(L,v1,v2,fop) { \ |
920 | lua_Number n1; lua_Number n2; \ | 920 | lua_Number n1; lua_Number n2; \ |