Skip to content

Commit

Permalink
MIPS64: Fix xpcall() error case.
Browse files Browse the repository at this point in the history
Thanks to François Perrad and Stefan Pejic.
  • Loading branch information
Mike Pall committed Nov 18, 2017
1 parent d417ded commit ea7071d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/vm_mips64.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ea7071d

Please sign in to comment.