mirror of
https://github.com/lua/lua
synced 2026-09-27 00:28:25 +03:00
Removed uneeded check in parser
In a constructor, each field generates at least one opcode, and the number of opcodes is limited by INT_MAX. Therefore, the counters for number of fields cannot exceed this limit. (The current limit for items in the hash part of a table has a limit smaller than INT_MAX. However, as long as there are no overflows, the logic for table resizing will handle that limit.)
This commit is contained in:
parent
c15543b9af
commit
519c57d597
1 changed files with 0 additions and 1 deletions
|
|
@ -908,7 +908,6 @@ static void recfield (LexState *ls, ConsControl *cc) {
|
||||||
codename(ls, &key);
|
codename(ls, &key);
|
||||||
else /* ls->t.token == '[' */
|
else /* ls->t.token == '[' */
|
||||||
yindex(ls, &key);
|
yindex(ls, &key);
|
||||||
luaY_checklimit(fs, cc->nh, INT_MAX / 2, "items in a constructor");
|
|
||||||
cc->nh++;
|
cc->nh++;
|
||||||
checknext(ls, '=');
|
checknext(ls, '=');
|
||||||
tab = *cc->t;
|
tab = *cc->t;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue