Commit 5df384077f3633ec8cf2e08f9199e5a44994dbad

Anthony Green 2014-09-18T19:05:35

Merge pull request #129 from frida/fix/darwin-aarch64-cif-prep Fix non-variadic CIF initialization for Apple/ARM64

diff --git a/src/aarch64/ffi.c b/src/aarch64/ffi.c
index b807a2d..05f1a13 100644
--- a/src/aarch64/ffi.c
+++ b/src/aarch64/ffi.c
@@ -779,6 +779,8 @@ ffi_prep_cif_machdep (ffi_cif *cif)
           }
     }
 
+  cif->aarch64_nfixedargs = 0;
+
   return FFI_OK;
 }
 
@@ -789,9 +791,13 @@ ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif,
 				    unsigned int nfixedargs,
 				    unsigned int ntotalargs)
 {
+  ffi_status status;
+
+  status = ffi_prep_cif_machdep (cif);
+
   cif->aarch64_nfixedargs = nfixedargs;
 
-  return ffi_prep_cif_machdep(cif);
+  return status;
 }
 
 #endif