summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/ExecutionEngine.cpp
diff options
context:
space:
mode:
authorAndrew Kaylor <andrew.kaylor@intel.com>2013-11-15 17:52:54 +0000
committerAndrew Kaylor <andrew.kaylor@intel.com>2013-11-15 17:52:54 +0000
commit48079e0fef9301442eb787d2234ea99ba3f06fa8 (patch)
tree993e2cc4208a8c0de677fe3afa816f475c498a03 /lib/ExecutionEngine/ExecutionEngine.cpp
parent2ba641b9577656e80922cb560ebf0551f3a4e273 (diff)
downloadllvm-48079e0fef9301442eb787d2234ea99ba3f06fa8.tar.gz
llvm-48079e0fef9301442eb787d2234ea99ba3f06fa8.tar.bz2
llvm-48079e0fef9301442eb787d2234ea99ba3f06fa8.tar.xz
Don't try to initialize memory for a global if the allocation failed in ExecutionEngine.
Patch by Dale Martin! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194831 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/ExecutionEngine.cpp')
-rw-r--r--lib/ExecutionEngine/ExecutionEngine.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp
index a8de4205da..73bd43ba51 100644
--- a/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -1289,6 +1289,10 @@ void ExecutionEngine::EmitGlobalVariable(const GlobalVariable *GV) {
if (GA == 0) {
// If it's not already specified, allocate memory for the global.
GA = getMemoryForGV(GV);
+
+ // If we failed to allocate memory for this global, return.
+ if (GA == 0) return;
+
addGlobalMapping(GV, GA);
}