[AsmPrinter] Check for valid constants in handleIndirectSymViaGOTPCRel
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Tue, 21 Jul 2015 21:45:42 +0000 (21:45 +0000)
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Tue, 21 Jul 2015 21:45:42 +0000 (21:45 +0000)
commita14dff356be24bec8a29522117c8363798838c86
treef719e655197ffe4691573b18719782004e249952
parent3f6881efa54ecb1afdf2fc1481e91e921ed7f9fc
[AsmPrinter] Check for valid constants in handleIndirectSymViaGOTPCRel

Check whether BaseCst is valid before extracting a GlobalValue.
This fixes PR24163.

Patch by David Majnemer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242840 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
test/MC/MachO/cstexpr-gotpcrel-64.ll