mirror of
https://github.com/lua/lua
synced 2026-09-27 00:28:25 +03:00
Bug: check for constructor overflow in [exp] fields
The check for constructor overflow was considering only fields with explicit names, ignoring fields with syntax '[exp]=exp'.
This commit is contained in:
parent
d1ee2a4deb
commit
267ef461d0
1 changed files with 2 additions and 3 deletions
|
|
@ -849,12 +849,11 @@ static void recfield (LexState *ls, ConsControl *cc) {
|
|||
FuncState *fs = ls->fs;
|
||||
int reg = ls->fs->freereg;
|
||||
expdesc tab, key, val;
|
||||
if (ls->t.token == TK_NAME) {
|
||||
checklimit(fs, cc->nh, MAX_INT, "items in a constructor");
|
||||
if (ls->t.token == TK_NAME)
|
||||
codename(ls, &key);
|
||||
}
|
||||
else /* ls->t.token == '[' */
|
||||
yindex(ls, &key);
|
||||
checklimit(fs, cc->nh, MAX_INT, "items in a constructor");
|
||||
cc->nh++;
|
||||
checknext(ls, '=');
|
||||
tab = *cc->t;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue