From 1334c0ae67fdf4cb1377e0e7a3ef291f5cf694c0 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Sat, 19 Oct 2024 00:35:11 +0800 Subject: Fixed issue #174. --- src/3rdParty/lua/lcode.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/3rdParty/lua/lcode.c') diff --git a/src/3rdParty/lua/lcode.c b/src/3rdParty/lua/lcode.c index caac6ba..8761614 100644 --- a/src/3rdParty/lua/lcode.c +++ b/src/3rdParty/lua/lcode.c @@ -776,7 +776,8 @@ void luaK_dischargevars (FuncState *fs, expdesc *e) { break; } case VLOCAL: { /* already in a register */ - e->u.info = e->u.var.ridx; + int temp = e->u.var.ridx; + e->u.info = temp; /* (can't do a direct assignment; values overlap) */ e->k = VNONRELOC; /* becomes a non-relocatable value */ break; } @@ -1283,8 +1284,9 @@ void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) { if (t->k == VUPVAL && !isKstr(fs, k)) /* upvalue indexed by non 'Kstr'? */ luaK_exp2anyreg(fs, t); /* put it in a register */ if (t->k == VUPVAL) { + int temp = t->u.info; /* upvalue index */ lua_assert(isKstr(fs, k)); - t->u.ind.t = t->u.info; /* upvalue index */ + t->u.ind.t = temp; /* (can't do a direct assignment; values overlap) */ t->u.ind.idx = k->u.info; /* literal short string */ t->k = VINDEXUP; } -- cgit v1.2.3-55-g6feb