Reported by Sergey Kaplun. #1114
cp_check(cp, '(');
if (cp->tok == CTOK_IDENT) {
if (cp->str->hash == H_(738e923c,a1b65954)) { /* push */
- if (cp->curpack < CPARSE_MAX_PACKSTACK) {
+ if (cp->curpack < CPARSE_MAX_PACKSTACK-1) {
cp->packstack[cp->curpack+1] = cp->packstack[cp->curpack];
cp->curpack++;
+ } else {
+ cp_errmsg(cp, cp->tok, LJ_ERR_XLEVELS);
}
} else if (cp->str->hash == H_(6c71cf27,6c71cf27)) { /* pop */
if (cp->curpack > 0) cp->curpack--;