PATCH: Properly check bad ABI
H.J. Lu
hongjiu.lu@intel.com
Sat Mar 3 18:34:00 GMT 2012
Hi,
This patch properly checks bad ABI. Otherwise,
libffi.call/err_bad_abi.c always fails on Linux/x86-64.
H.J.
--
2012-03-03 H.J. Lu <hongjiu.lu@intel.com>
* src/prep_cif.c (ffi_prep_cif_core): Properly check bad ABI.
diff --git a/src/prep_cif.c b/src/prep_cif.c
index f50a63c..33993ad 100644
--- a/src/prep_cif.c
+++ b/src/prep_cif.c
@@ -112,7 +112,7 @@ ffi_status FFI_HIDDEN ffi_prep_cif_core(ffi_cif *cif, ffi_abi abi,
FFI_ASSERT(nfixedargs <= ntotalargs);
#ifndef X86_WIN32
- if (! (abi > FFI_FIRST_ABI) && (abi <= FFI_LAST_ABI))
+ if (! (abi > FFI_FIRST_ABI && abi <= FFI_LAST_ABI))
return FFI_BAD_ABI;
#else
if (! (abi > FFI_FIRST_ABI && abi < FFI_LAST_ABI || abi == FFI_THISCALL))
More information about the Libffi-discuss
mailing list