summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
diff options
context:
space:
mode:
authorNicolas Geoffray <nicolas.geoffray@lip6.fr>2009-10-22 14:35:57 +0000
committerNicolas Geoffray <nicolas.geoffray@lip6.fr>2009-10-22 14:35:57 +0000
commit7e8017cce756eed30478f14f0f195830a3690b66 (patch)
tree122ba06c422521a1bf6a229296e2a003a59a70f2 /llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
parent2a536740a472598f7cfc608ba14ea4685843ee12 (diff)
downloadbcm5719-llvm-7e8017cce756eed30478f14f0f195830a3690b66.tar.gz
bcm5719-llvm-7e8017cce756eed30478f14f0f195830a3690b66.zip
Verify that the function and exception table have been allocated
before freeing them. llvm-svn: 84859
Diffstat (limited to 'llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp b/llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
index ea9d09fffc7..37966246214 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,
OpenPOWER on IntegriCloud