summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2017-05-08 23:46:20 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2017-05-08 23:46:20 +0000
commitf7e8acf0fc6c7031dc312ddc1e83496bdce2b454 (patch)
tree8a2292265131720a71a5d171518dd2f6c51f56ef /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parent918e8157d89e317ebe200bba52958889c3687ee2 (diff)
downloadbcm5719-llvm-f7e8acf0fc6c7031dc312ddc1e83496bdce2b454.tar.gz
bcm5719-llvm-f7e8acf0fc6c7031dc312ddc1e83496bdce2b454.zip
Ignore !associated metadata with null argument.
Fixes PR32577 (comment 10). Such metadata may legitimately appear in LTO. llvm-svn: 302485
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 34892680ace..1d232c71d82 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -232,7 +232,11 @@ static const MCSymbolELF *getAssociatedSymbol(const GlobalObject *GO,
if (!MD)
return nullptr;
- auto *VM = dyn_cast<ValueAsMetadata>(MD->getOperand(0));
+ const MDOperand &Op = MD->getOperand(0);
+ if (!Op.get())
+ return nullptr;
+
+ auto *VM = dyn_cast<ValueAsMetadata>(Op);
if (!VM)
report_fatal_error("MD_associated operand is not ValueAsMetadata");
OpenPOWER on IntegriCloud