From 7e8017cce756eed30478f14f0f195830a3690b66 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Thu, 22 Oct 2009 14:35:57 +0000 Subject: [PATCH] Verify that the function and exception table have been allocated before freeing them. llvm-svn: 84859 --- llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp b/llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp index ea9d09fffc7e..379662462147 100644 --- a/llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp +++ b/llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp @@ -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,