summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2019-03-01 00:12:13 +0000
committerThomas Lively <tlively@google.com>2019-03-01 00:12:13 +0000
commitae79f42a2fdd1321430a9266476b66eb932da0c9 (patch)
treecaa33832056c5dc9f40e930b890f7912bbbad8dd /llvm/lib/Target/WebAssembly
parent41f32196a0b3850fb578b741fb81f44dbd30a68b (diff)
downloadbcm5719-llvm-ae79f42a2fdd1321430a9266476b66eb932da0c9.tar.gz
bcm5719-llvm-ae79f42a2fdd1321430a9266476b66eb932da0c9.zip
[WebAssembly] Fix crash when @llvm.global_dtors is external
Reviewers: aheejin Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58799 llvm-svn: 355157
Diffstat (limited to 'llvm/lib/Target/WebAssembly')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyLowerGlobalDtors.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyLowerGlobalDtors.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyLowerGlobalDtors.cpp
index 72e0c33e1e0..494d3fadbc8 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyLowerGlobalDtors.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyLowerGlobalDtors.cpp
@@ -61,7 +61,7 @@ bool LowerGlobalDtors::runOnModule(Module &M) {
LLVM_DEBUG(dbgs() << "********** Lower Global Destructors **********\n");
GlobalVariable *GV = M.getGlobalVariable("llvm.global_dtors");
- if (!GV)
+ if (!GV || !GV->hasInitializer())
return false;
const ConstantArray *InitList = dyn_cast<ConstantArray>(GV->getInitializer());
OpenPOWER on IntegriCloud