MIPS64: Fix xpcall() error case.

Thanks to François Perrad and Stefan Pejic.
This commit is contained in:
Mike Pall 2017-11-18 12:25:35 +01:00
parent d417ded179
commit ea7071d3c3

View File

@ -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