MC/Mach-O/i386: Fix a crash in relocation handling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114176 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar
2010-09-17 15:21:50 +00:00
parent 4cec6e2103
commit 23bea41ec6
2 changed files with 38 additions and 33 deletions

View File

@@ -797,7 +797,8 @@ public:
unsigned Log2Size = getFixupKindLog2Size(Fixup.getKind());
// If this is a 32-bit TLVP reloc it's handled a bit differently.
if (Target.getSymA()->getKind() == MCSymbolRefExpr::VK_TLVP) {
if (Target.getSymA() &&
Target.getSymA()->getKind() == MCSymbolRefExpr::VK_TLVP) {
RecordTLVPRelocation(Asm, Layout, Fragment, Fixup, Target, FixedValue);
return;
}