mirror of
https://github.com/lua/lua
synced 2026-09-27 00:28:25 +03:00
Wrong assert in 'luaK_indexed'
This commit is contained in:
parent
985ef32248
commit
8164d09338
1 changed files with 5 additions and 3 deletions
8
lcode.c
8
lcode.c
|
|
@ -1370,9 +1370,11 @@ void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) {
|
|||
fillidxk(t, k->u.info, VINDEXUP); /* literal short string */
|
||||
}
|
||||
else if (t->k == VVARGVAR) { /* indexing the vararg parameter? */
|
||||
lua_assert(t->u.ind.t == fs->f->numparams);
|
||||
t->u.ind.t = cast_byte(t->u.var.ridx);
|
||||
fillidxk(t, luaK_exp2anyreg(fs, k), VVARGIND); /* register */
|
||||
int kreg = luaK_exp2anyreg(fs, k); /* put key in some register */
|
||||
lu_byte vreg = cast_byte(t->u.var.ridx); /* register with vararg param. */
|
||||
lua_assert(vreg == fs->f->numparams);
|
||||
t->u.ind.t = vreg; /* (avoid a direct assignment; values may overlap) */
|
||||
fillidxk(t, kreg, VVARGIND); /* 't' represents 'vararg[k]' */
|
||||
}
|
||||
else {
|
||||
/* register index of the table */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue