Commit 40e4063ab4449c644bc106298805fa8c6cfadbd4

Richard Henderson 2016-07-07T23:11:38

Merge pull request #261 from tromey/fix-260 Don't dereference "ecif" before NULL check

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/src/microblaze/ffi.c b/src/microblaze/ffi.c
index ea962ea..5733e6e 100644
--- a/src/microblaze/ffi.c
+++ b/src/microblaze/ffi.c
@@ -46,12 +46,12 @@ void ffi_prep_args(void* stack, extended_cif* ecif)
 	void** p_argv;
 	void* stack_args_p = stack;
 
-	p_argv = ecif->avalue;
-
 	if (ecif == NULL || ecif->cif == NULL) {
 		return; /* no description to prepare */
 	}
 
+	p_argv = ecif->avalue;
+
 	if ((ecif->cif->rtype != NULL) &&
 			(ecif->cif->rtype->type == FFI_TYPE_STRUCT))
 	{