aarch64: Fix handling of variadic closures on iOS
authorOle André Vadla Ravnås <oleavr@gmail.com>
Wed, 10 Aug 2016 13:59:56 +0000 (15:59 +0200)
committerOle André Vadla Ravnås <oleavr@gmail.com>
Wed, 10 Aug 2016 15:05:00 +0000 (17:05 +0200)
src/aarch64/ffi.c

index cf33abc..78328a8 100644 (file)
@@ -917,6 +917,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;