summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2015-07-21 21:45:42 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2015-07-21 21:45:42 +0000
commite8640518a983eccbe7990885acf53bd6976c5067 (patch)
tree421d189af1033cd1d64ac1e3cb6dc651d621ce63 /llvm/lib/CodeGen/AsmPrinter
parent402a4f10886cf3ceee58f5614df9606f719d6793 (diff)
downloadbcm5719-llvm-e8640518a983eccbe7990885acf53bd6976c5067.tar.gz
bcm5719-llvm-e8640518a983eccbe7990885acf53bd6976c5067.zip
[AsmPrinter] Check for valid constants in handleIndirectSymViaGOTPCRel
Check whether BaseCst is valid before extracting a GlobalValue. This fixes PR24163. Patch by David Majnemer. llvm-svn: 242840
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 068b9172e9f..ecdc7fa8b35 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -2101,7 +2101,7 @@ static void handleIndirectSymViaGOTPCRel(AsmPrinter &AP, const MCExpr **ME,
if (!AP.GlobalGOTEquivs.count(GOTEquivSym))
return;
- const GlobalValue *BaseGV = dyn_cast<GlobalValue>(BaseCst);
+ const GlobalValue *BaseGV = dyn_cast_or_null<GlobalValue>(BaseCst);
if (!BaseGV)
return;
OpenPOWER on IntegriCloud