This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Properly check bad ABI


On 3/3/2012 1:33 PM, H.J. Lu wrote:
Hi,

This patch properly checks bad ABI.  Otherwise,
libffi.call/err_bad_abi.c always fails on Linux/x86-64.

Thanks H.J.,


  I've committed this, with a minor adjustment...
abi <= FFI_LAST_ABI  should be abi < FFI_LAST_ABI

Thanks,

AG





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))



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]