-
Notifications
You must be signed in to change notification settings - Fork 933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stack overflow cannot be properly reported by xpcall #962
Comments
…ck size reaches LJ_STACK_MAXEX so that a potential error handler invoked by xpcall can still grow the stack one last time instead of causing a LUA_ERRERR. See LuaJIT#962
Fixed. Thanks! |
This change (8135de2) has the unfortunate side effect of causing stack overflows to be reported long before they need to be; suppose |
I rewrote the stack overflow handling to resolve your concerns. |
Reported by Peter Cawley. LuaJIT#962
The stack overflow check in
lj_state_growstack
does not account for a potential error handler invoked byxpcall
. Changing it toif (L->stacksize >= LJ_STACK_MAXEX)
allows the error handler to be called without causing a second error. The way it is now when the error handler requests a stack slot for the error object it bumps into the check at the beginning oflj_state_growstack
and raises aLUA_ERRERR
.Current behaviour:
Expected behaviour:
The text was updated successfully, but these errors were encountered: