summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit3b4423793827cff2712fd08c77804305540b62be (patch)
tree0d9335abb42b5c596d5d8c51a2f88444c1989a1c /llvm/lib/ExecutionEngine/ExecutionEngine.cpp
parent617e49ad59a96eb972e270fda36981ced0acb57c (diff)
downloadbcm5719-llvm-3b4423793827cff2712fd08c77804305540b62be.tar.gz
bcm5719-llvm-3b4423793827cff2712fd08c77804305540b62be.zip
Don't try to initialize memory for a global if the allocation failed in ExecutionEngine.
Patch by Dale Martin! llvm-svn: 194831
Diffstat (limited to 'llvm/lib/ExecutionEngine/ExecutionEngine.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/ExecutionEngine.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
index a8de4205dad..73bd43ba515 100644
--- a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/llvm/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);
}
OpenPOWER on IntegriCloud