summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MachObjectWriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/MC/MachObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/MachObjectWriter.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/MC/MachObjectWriter.cpp b/llvm/lib/MC/MachObjectWriter.cpp
index 7f6d12ce238..577c4b75f97 100644
--- a/llvm/lib/MC/MachObjectWriter.cpp
+++ b/llvm/lib/MC/MachObjectWriter.cpp
@@ -726,6 +726,10 @@ IsSymbolRefDifferenceFullyResolvedImpl(const MCAssembler &Asm,
return false;
}
+ // If they are not in the same section, we can't compute the diff.
+ if (&SecA != &SecB)
+ return false;
+
const MCFragment *FA = Asm.getSymbolData(SA).getFragment();
// Bail if the symbol has no fragment.
@@ -733,12 +737,7 @@ IsSymbolRefDifferenceFullyResolvedImpl(const MCAssembler &Asm,
return false;
A_Base = FA->getAtom();
- if (!A_Base)
- return false;
-
B_Base = FB.getAtom();
- if (!B_Base)
- return false;
// If the atoms are the same, they are guaranteed to have the same address.
if (A_Base == B_Base)
OpenPOWER on IntegriCloud