Author: Armin Rigo <[email protected]>
Branch: win64
Changeset: r1303:a01a34a12473
Date: 2013-08-01 11:19 +0200
http://bitbucket.org/cffi/cffi/changeset/a01a34a12473/

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

diff --git a/c/libffi_msvc/ffi.c b/c/libffi_msvc/ffi.c
--- a/c/libffi_msvc/ffi.c
+++ b/c/libffi_msvc/ffi.c
@@ -221,8 +221,7 @@
 #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;
diff --git a/c/libffi_msvc/prep_cif.c b/c/libffi_msvc/prep_cif.c
--- a/c/libffi_msvc/prep_cif.c
+++ b/c/libffi_msvc/prep_cif.c
@@ -168,6 +168,12 @@
 #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 */
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to