Commit 6aa15900accc0a648cdebf11ec11d11697ebfffd

Vitaly Budovski 2013-09-05T12:05:06

Don't use 16 byte aligned stack for WIN32 This fixes a crash when accessing __stdcall functions in Python ctypes.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/x86/ffi.c b/src/x86/ffi.c
index 0600414..307cd19 100644
--- a/src/x86/ffi.c
+++ b/src/x86/ffi.c
@@ -315,7 +315,9 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
   cif->bytes += 4 * sizeof(ffi_arg);
 #endif
 
+#ifndef X86_WIN32
   cif->bytes = (cif->bytes + 15) & ~0xF;
+#endif
 
   return FFI_OK;
 }