Skip to content

Commit

Permalink
ARM64: Fix xpcall() error case (really).
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 734a3fa commit d417ded
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/vm_arm64.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -1182,14 +1182,15 @@ static void build_subroutines(BuildCtx *ctx)
|.ffunc xpcall
| ldp CARG1, CARG2, [BASE]
| ldrb TMP0w, GL->hookmask
| subs NARGS8:RC, NARGS8:RC, #16
| subs NARGS8:TMP1, NARGS8:RC, #16
| blo ->fff_fallback
| mov RB, BASE
| asr ITYPE, CARG2, #47
| ubfx TMP0w, TMP0w, #HOOK_ACTIVE_SHIFT, #1
| cmn ITYPE, #-LJ_TFUNC
| add PC, TMP0, #24+FRAME_PCALL
| bne ->fff_fallback // Traceback must be a function.
| mov NARGS8:RC, NARGS8:TMP1
| add BASE, BASE, #24
| stp CARG2, CARG1, [RB] // Swap function and traceback.
| cbz NARGS8:RC, ->vm_call_dispatch
Expand Down

0 comments on commit d417ded

Please sign in to comment.