This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
PATCH: Properly check bad ABI
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: libffi-discuss at sourceware dot org
- Date: Sat, 3 Mar 2012 10:33:49 -0800
- Subject: PATCH: Properly check bad ABI
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
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))