Commits

Armin Rigo  committed a01a34a

I fail to see how "cif->bytes ? cif->bytes : 40" means "at least 40".
It seems to mean only "not 0" to me.

  • Participants
  • Parent commits 89277a8
  • Branches win64

Comments (0)

Files changed (2)

File c/libffi_msvc/ffi.c

 #else
     case FFI_SYSV:
       /*@-usedef@*/
-      /* Function call needs at least 40 bytes stack size, on win64 AMD64 */
-      return ffi_call_AMD64(ffi_prep_args, &ecif, cif->bytes ? cif->bytes : 40,
+      return ffi_call_AMD64(ffi_prep_args, &ecif, cif->bytes,
 			   cif->flags, ecif.rvalue, fn);
       /*@=usedef@*/
       break;

File c/libffi_msvc/prep_cif.c

 #endif
     }
 
+#ifdef _WIN64
+  /* Function call needs at least 40 bytes stack size, on win64 AMD64 */
+  if (bytes < 40)
+      bytes = 40;
+#endif
+
   cif->bytes = bytes;
 
   /* Perform machine dependent cif processing */