From ea7071d3c30b6432bfe6f8a9d263e0285cec25e3 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Sat, 18 Nov 2017 12:25:35 +0100 Subject: [PATCH] MIPS64: Fix xpcall() error case. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks to François Perrad and Stefan Pejic. --- src/vm_mips64.dasc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/vm_mips64.dasc b/src/vm_mips64.dasc index 75b38dee..a78cd251 100644 --- a/src/vm_mips64.dasc +++ b/src/vm_mips64.dasc @@ -1399,15 +1399,16 @@ static void build_subroutines(BuildCtx *ctx) |. nop | |.ffunc xpcall - | daddiu NARGS8:RC, NARGS8:RC, -16 + | daddiu NARGS8:TMP0, NARGS8:RC, -16 | ld CARG1, 0(BASE) | ld CARG2, 8(BASE) - | bltz NARGS8:RC, ->fff_fallback + | bltz NARGS8:TMP0, ->fff_fallback |. lbu TMP1, DISPATCH_GL(hookmask)(DISPATCH) | gettp AT, CARG2 | daddiu AT, AT, -LJ_TFUNC | bnez AT, ->fff_fallback // Traceback must be a function. |. move TMP2, BASE + | move NARGS8:RC, NARGS8:TMP0 | daddiu BASE, BASE, 24 | // Remember active hook before pcall. | srl TMP3, TMP3, HOOK_ACTIVE_SHIFT