diff options
author | Andreas Tobler <a.tobler@schweiz.ch> | 2003-11-06 16:47:41 +0100 |
---|---|---|
committer | Andreas Tobler <andreast@gcc.gnu.org> | 2003-11-06 16:47:41 +0100 |
commit | 2b04d015d61b0d5def8eccc1f3d08694968882fe (patch) | |
tree | ed26b47e0a373a78dddf380b9d92e83c360f04dd /libffi/src | |
parent | 4b886873914887e749e96c8638928c524060edf6 (diff) | |
download | gcc-2b04d015d61b0d5def8eccc1f3d08694968882fe.zip gcc-2b04d015d61b0d5def8eccc1f3d08694968882fe.tar.gz gcc-2b04d015d61b0d5def8eccc1f3d08694968882fe.tar.bz2 |
prep_cif.c (ffi_prep_cif): Move the validity check after the initialization.
2003-11-06 Andreas Tobler <a.tobler@schweiz.ch>
* src/prep_cif.c (ffi_prep_cif): Move the validity check after
the initialization.
From-SVN: r73309
Diffstat (limited to 'libffi/src')
-rw-r--r-- | libffi/src/prep_cif.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libffi/src/prep_cif.c b/libffi/src/prep_cif.c index f43ccfc..3ee5ead 100644 --- a/libffi/src/prep_cif.c +++ b/libffi/src/prep_cif.c @@ -125,13 +125,15 @@ ffi_status ffi_prep_cif(/*@out@*/ /*@partial@*/ ffi_cif *cif, for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) { - /* Perform a sanity check on the argument type */ - FFI_ASSERT_VALID_TYPE(*ptr); /* Initialize any uninitialized aggregate type definitions */ if (((*ptr)->size == 0) && (initialize_aggregate((*ptr)) != FFI_OK)) return FFI_BAD_TYPEDEF; + /* Perform a sanity check on the argument type, do this + check after the initialization. */ + FFI_ASSERT_VALID_TYPE(*ptr); + #if !defined __x86_64__ && !defined S390 #ifdef SPARC if (((*ptr)->type == FFI_TYPE_STRUCT |