Darwin/ARM: Assert on NULL dereference This inhibits an analyzer warning by Clang on all platforms.
diff --git a/src/arm/ffi.c b/src/arm/ffi.c
index 9f238e1..3b39056 100644
--- a/src/arm/ffi.c
+++ b/src/arm/ffi.c
@@ -350,9 +350,17 @@ void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
break;
}
if (small_struct)
- memcpy (rvalue, &temp, cif->rtype->size);
+ {
+ FFI_ASSERT(rvalue != NULL);
+ memcpy (rvalue, &temp, cif->rtype->size);
+ }
+
else if (vfp_struct)
- memcpy (rvalue, ecif.rvalue, cif->rtype->size);
+ {
+ FFI_ASSERT(rvalue != NULL);
+ memcpy (rvalue, ecif.rvalue, cif->rtype->size);
+ }
+
}
/** private members **/