diff options
author | kkojima <kkojima@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-03-13 22:50:16 +0000 |
---|---|---|
committer | kkojima <kkojima@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-03-13 22:50:16 +0000 |
commit | 6f3435086d894523ecee2acd2fc2b07de9e8fbe5 (patch) | |
tree | d9bc825e34f48648ec69abf6928f0e84af830b89 /libffi | |
parent | 8e4de83abc921c9bc22852bf52bc6c6fea162e99 (diff) | |
download | gcc-6f3435086d894523ecee2acd2fc2b07de9e8fbe5.tar.gz |
* src/sh/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test,
just return FFI_BAD_ABI when things are wrong.
* src/sh64/ffi.c (ffi_prep_closure_loc): Ditto.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185361 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libffi')
-rw-r--r-- | libffi/ChangeLog | 6 | ||||
-rw-r--r-- | libffi/src/sh/ffi.c | 5 | ||||
-rw-r--r-- | libffi/src/sh64/ffi.c | 5 |
3 files changed, 12 insertions, 4 deletions
diff --git a/libffi/ChangeLog b/libffi/ChangeLog index bb5bc1625ce..28847807d9e 100644 --- a/libffi/ChangeLog +++ b/libffi/ChangeLog @@ -1,3 +1,9 @@ +2012-03-13 Kaz Kojima <kkojima@gcc.gnu.org> + + * src/sh/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test, + just return FFI_BAD_ABI when things are wrong. + * src/sh64/ffi.c (ffi_prep_closure_loc): Ditto. + 2012-03-03 H.J. Lu <hongjiu.lu@intel.com> * src/x86/ffi64.c (ffi_call): Cast the return value to unsigned diff --git a/libffi/src/sh/ffi.c b/libffi/src/sh/ffi.c index 69bd025fb8f..3515b91b1d0 100644 --- a/libffi/src/sh/ffi.c +++ b/libffi/src/sh/ffi.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Kaz Kojima + ffi.c - Copyright (c) 2002-2008, 2012 Kaz Kojima Copyright (c) 2008 Red Hat, Inc. SuperH Foreign Function Interface @@ -463,7 +463,8 @@ ffi_prep_closure_loc (ffi_closure* closure, unsigned int *tramp; unsigned int insn; - FFI_ASSERT (cif->abi == FFI_GCC_SYSV); + if (cif->abi != FFI_SYSV) + return FFI_BAD_ABI; tramp = (unsigned int *) &closure->tramp[0]; /* Set T bit if the function returns a struct pointed with R2. */ diff --git a/libffi/src/sh64/ffi.c b/libffi/src/sh64/ffi.c index 8fbc05ca6eb..123b87ace92 100644 --- a/libffi/src/sh64/ffi.c +++ b/libffi/src/sh64/ffi.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2003, 2004, 2006, 2007 Kaz Kojima + ffi.c - Copyright (c) 2003, 2004, 2006, 2007, 2012 Kaz Kojima Copyright (c) 2008 Anthony Green SuperH SHmedia Foreign Function Interface @@ -302,7 +302,8 @@ ffi_prep_closure_loc (ffi_closure *closure, { unsigned int *tramp; - FFI_ASSERT (cif->abi == FFI_GCC_SYSV); + if (cif->abi != FFI_SYSV) + return FFI_BAD_ABI; tramp = (unsigned int *) &closure->tramp[0]; /* Since ffi_closure is an aligned object, the ffi trampoline is |