Skip to content

Commit 752d784

Browse files
committed
Pick e42520c for libffi
1 parent ed11ac5 commit 752d784

File tree

1 file changed

+5
-4
lines changed
  • native/libffi/src/aarch64

1 file changed

+5
-4
lines changed

native/libffi/src/aarch64/ffi.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -660,12 +660,13 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *orig_rvalue,
660660
state.ngrn = N_X_ARG_REG;
661661
/* Note that the default abi extends each argument
662662
to a full 64-bit slot, while the iOS abi allocates
663-
only enough space. */
663+
only enough space, except for variadic arguments. */
664664
#ifdef __APPLE__
665-
memcpy(d, a, s);
666-
#else
667-
*(ffi_arg *)d = ext;
665+
if (!state.allocating_variadic)
666+
memcpy(d, a, s);
667+
else
668668
#endif
669+
*(ffi_arg *)d = ext;
669670
}
670671
}
671672
break;

0 commit comments

Comments
 (0)