Explorar o código

FFI/ARM64: Fix pass-by-value struct calling conventions.

Mike Pall %!s(int64=5) %!d(string=hai) anos
pai
achega
9143e86498
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      src/lj_ccall.c

+ 2 - 1
src/lj_ccall.c

@@ -337,7 +337,8 @@
   if (LJ_TARGET_IOS && isva) { \
     /* IOS: All variadic arguments are on the stack. */ \
   } else if (isfp) {  /* Try to pass argument in FPRs. */ \
-    int n2 = ctype_isvector(d->info) ? 1 : n*isfp; \
+    int n2 = ctype_isvector(d->info) ? 1 : \
+	     isfp == 1 ? n : (d->size >> (4-isfp)); \
     if (nfpr + n2 <= CCALL_NARG_FPR) { \
       dp = &cc->fpr[nfpr]; \
       nfpr += n2; \