From 519c57d597625f010d1bbb3f91bac5d193111060 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 4 Jun 2025 09:54:31 -0300 Subject: 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.) --- lparser.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lparser.c b/lparser.c index 992d45bd..9abaa374 100644 --- a/lparser.c +++ b/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; -- cgit v1.2.3-55-g6feb