Commit a8e0a835ab1f62d03ad6391760e3e8b7732d24f8

Zachary Waldowski 2013-12-30T15:26:20

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 **/