mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-04-20 05:53:26 +00:00
FFI: Fix pragma push stack limit check and throw on overflow.
Reported by Sergey Kaplun. #1114
This commit is contained in:
parent
d133d67c88
commit
433d7e8d8d
@ -1747,9 +1747,11 @@ static void cp_pragma(CPState *cp, BCLine pragmaline)
|
|||||||
cp_check(cp, '(');
|
cp_check(cp, '(');
|
||||||
if (cp->tok == CTOK_IDENT) {
|
if (cp->tok == CTOK_IDENT) {
|
||||||
if (cp->str->hash == H_(738e923c,a1b65954)) { /* push */
|
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->packstack[cp->curpack+1] = cp->packstack[cp->curpack];
|
||||||
cp->curpack++;
|
cp->curpack++;
|
||||||
|
} else {
|
||||||
|
cp_errmsg(cp, cp->tok, LJ_ERR_XLEVELS);
|
||||||
}
|
}
|
||||||
} else if (cp->str->hash == H_(6c71cf27,6c71cf27)) { /* pop */
|
} else if (cp->str->hash == H_(6c71cf27,6c71cf27)) { /* pop */
|
||||||
if (cp->curpack > 0) cp->curpack--;
|
if (cp->curpack > 0) cp->curpack--;
|
||||||
|
Loading…
Reference in New Issue
Block a user