From ba6344d1ef4b3013dc83b434df2610fe8dbf5617 Mon Sep 17 00:00:00 2001
From: Mike Pall <mike>
Date: Tue, 14 Jul 2015 13:04:08 +0200
Subject: ARM64: Fix __call metamethod handling for tail calls.

---
 src/vm_arm64.dasc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/vm_arm64.dasc b/src/vm_arm64.dasc
index d772f95b..f1251f2c 100644
--- a/src/vm_arm64.dasc
+++ b/src/vm_arm64.dasc
@@ -853,10 +853,10 @@ static void build_subroutines(BuildCtx *ctx)
   |   str PC, SAVE_PC
   |  add CARG3, RA, NARGS8:RC
   |  bl extern lj_meta_call	// (lua_State *L, TValue *func, TValue *top)
-  |  ldr LFUNC:CARG3, [RA, FRAME_FUNC]	// Guaranteed to be a function here.
+  |  ldr TMP1, [RA, FRAME_FUNC]		// Guaranteed to be a function here.
   |   ldr PC, [BASE, FRAME_PC]
   |   add NARGS8:RC, NARGS8:RC, #8	// Got one more argument now.
-  |  and LFUNC:CARG3, CARG3, #LJ_GCVMASK
+  |  and LFUNC:CARG3, TMP1, #LJ_GCVMASK
   |  b ->BC_CALLT2_Z
   |
   |//-- Argument coercion for 'for' statement ------------------------------
-- 
cgit v1.2.3-55-g6feb