Преглед на файлове

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.)
Roberto Ierusalimschy преди 3 месеца
родител
ревизия
519c57d597
променени са 1 файла, в които са добавени 0 реда и са изтрити 1 реда
  1. 0 1
      lparser.c

+ 0 - 1
lparser.c

@@ -908,7 +908,6 @@ static void recfield (LexState *ls, ConsControl *cc) {
     codename(ls, &key);
   else  /* ls->t.token == '[' */
     yindex(ls, &key);
-  luaY_checklimit(fs, cc->nh, INT_MAX / 2, "items in a constructor");
   cc->nh++;
   checknext(ls, '=');
   tab = *cc->t;