mirror of
https://github.com/lua/lua.git
synced 2026-01-26 15:39:12 +00:00
Wrong assert in 'luaK_indexed'
This commit is contained in:
parent
985ef32248
commit
8164d09338
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…
x
Reference in New Issue
Block a user