diff options
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/ExecutionEngine/ExecutionEngine.cpp | 4 |
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); } |

