diff options
author | Li Jin <dragon-fly@qq.com> | 2024-10-19 00:35:11 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2024-10-19 00:35:11 +0800 |
commit | 1334c0ae67fdf4cb1377e0e7a3ef291f5cf694c0 (patch) | |
tree | 8bd3fbeb396fd2fce6e5b34c3ee10f4923feca72 /src/3rdParty/lua/lcode.c | |
parent | 05da3cbfa3689e6c229c41156d0dd08ab554cd77 (diff) | |
download | yuescript-1334c0ae67fdf4cb1377e0e7a3ef291f5cf694c0.tar.gz yuescript-1334c0ae67fdf4cb1377e0e7a3ef291f5cf694c0.tar.bz2 yuescript-1334c0ae67fdf4cb1377e0e7a3ef291f5cf694c0.zip |
Fixed issue #174.
Diffstat (limited to 'src/3rdParty/lua/lcode.c')
-rw-r--r-- | src/3rdParty/lua/lcode.c | 6 |
1 files changed, 4 insertions, 2 deletions
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) { | |||
776 | break; | 776 | break; |
777 | } | 777 | } |
778 | case VLOCAL: { /* already in a register */ | 778 | case VLOCAL: { /* already in a register */ |
779 | e->u.info = e->u.var.ridx; | 779 | int temp = e->u.var.ridx; |
780 | e->u.info = temp; /* (can't do a direct assignment; values overlap) */ | ||
780 | e->k = VNONRELOC; /* becomes a non-relocatable value */ | 781 | e->k = VNONRELOC; /* becomes a non-relocatable value */ |
781 | break; | 782 | break; |
782 | } | 783 | } |
@@ -1283,8 +1284,9 @@ void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) { | |||
1283 | if (t->k == VUPVAL && !isKstr(fs, k)) /* upvalue indexed by non 'Kstr'? */ | 1284 | if (t->k == VUPVAL && !isKstr(fs, k)) /* upvalue indexed by non 'Kstr'? */ |
1284 | luaK_exp2anyreg(fs, t); /* put it in a register */ | 1285 | luaK_exp2anyreg(fs, t); /* put it in a register */ |
1285 | if (t->k == VUPVAL) { | 1286 | if (t->k == VUPVAL) { |
1287 | int temp = t->u.info; /* upvalue index */ | ||
1286 | lua_assert(isKstr(fs, k)); | 1288 | lua_assert(isKstr(fs, k)); |
1287 | t->u.ind.t = t->u.info; /* upvalue index */ | 1289 | t->u.ind.t = temp; /* (can't do a direct assignment; values overlap) */ |
1288 | t->u.ind.idx = k->u.info; /* literal short string */ | 1290 | t->u.ind.idx = k->u.info; /* literal short string */ |
1289 | t->k = VINDEXUP; | 1291 | t->k = VINDEXUP; |
1290 | } | 1292 | } |