Verify that the function and exception table have been allocated
[oota-llvm.git] / lib / ExecutionEngine / JIT / JITMemoryManager.cpp
index ea9d09fffc7e26987965a608750166b5aeb3a2e3..3796624621474c449c3c527e1b4c342a43c9b6a4 100644 (file)
@@ -490,13 +490,13 @@ namespace {
     /// deallocateFunctionBody - Deallocate all memory for the specified
     /// function body.
     void deallocateFunctionBody(void *Body) {
-      deallocateBlock(Body);
+      if (Body) deallocateBlock(Body);
     }
 
     /// deallocateExceptionTable - Deallocate memory for the specified
     /// exception table.
     void deallocateExceptionTable(void *ET) {
-      deallocateBlock(ET);
+      if (ET) deallocateBlock(ET);
     }
 
     /// setMemoryWritable - When code generation is in progress,