Commit 06d7c5190e910356d4212d2a79056df8b70fd27e

Tom Tromey 2016-08-10T15:06:16

Merge pull request #269 from frida/fix/aarch64-variadic-closures-on-ios aarch64: Fix handling of variadic closures on iOS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/src/aarch64/ffi.c b/src/aarch64/ffi.c
index b4a7a89..e7cf6ce 100644
--- a/src/aarch64/ffi.c
+++ b/src/aarch64/ffi.c
@@ -920,6 +920,15 @@ ffi_closure_SYSV_inner (ffi_cif *cif,
 	default:
 	  abort();
 	}
+
+#if defined (__APPLE__)
+      if (i + 1 == cif->aarch64_nfixedargs)
+	{
+	  state.ngrn = N_X_ARG_REG;
+	  state.nsrn = N_V_ARG_REG;
+	  state.allocating_variadic = 1;
+	}
+#endif
     }
 
   flags = cif->flags;