Handle on-trace OOM errors from helper functions.

This commit is contained in:
Mike Pall
2021-03-23 00:35:46 +01:00
parent ddd0fd8f37
commit a32aeadc68
24 changed files with 421 additions and 51 deletions

View File

@@ -501,6 +501,10 @@ static void build_subroutines(BuildCtx *ctx)
| b ->vm_returnc
|. li RD, 16 // 2 results: false + error message.
|
|->vm_unwind_stub: // Jump to exit stub from unwinder.
| jr CARG1
|. move ra, CARG2
|
|//-----------------------------------------------------------------------
|//-- Grow stack for calls -----------------------------------------------
|//-----------------------------------------------------------------------
@@ -2520,8 +2524,9 @@ static void build_subroutines(BuildCtx *ctx)
|. addu RA, RA, BASE
|
|9: // Rethrow error from the right C frame.
| load_got lj_err_run
| call_intern lj_err_run // (lua_State *L)
| load_got lj_err_trace
| sub CARG2, r0, CRET1
| call_intern lj_err_trace // (lua_State *L, int errcode)
|. move CARG1, L
|.endif
|