diff options
author | Kevin Enderby <enderby@apple.com> | 2012-01-31 23:02:57 +0000 |
---|---|---|
committer | Kevin Enderby <enderby@apple.com> | 2012-01-31 23:02:57 +0000 |
commit | d49b2a7a9d927bb8c314a8c66f7f2e5f3aef4ffd (patch) | |
tree | 25bf74b081244aad5d0599b2af0eed24f7b16ca9 /lib | |
parent | bda59fdd71033a8ddfa30ec4b514753017f3da5c (diff) | |
download | external_llvm-d49b2a7a9d927bb8c314a8c66f7f2e5f3aef4ffd.zip external_llvm-d49b2a7a9d927bb8c314a8c66f7f2e5f3aef4ffd.tar.gz external_llvm-d49b2a7a9d927bb8c314a8c66f7f2e5f3aef4ffd.tar.bz2 |
Fixed a crash in llvm-mc for Mach-O when a symbol difference expression uses a
symbol from an assignment. In this case the symbol did not have a fragment so
MCObjectWriter::IsSymbolRefDifferenceFullyResolved() should not have been
calling IsSymbolRefDifferenceFullyResolvedImpl() with a NULL fragment and should
just have returned false in that case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149442 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/MC/MCObjectWriter.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/MC/MCObjectWriter.cpp b/lib/MC/MCObjectWriter.cpp index 1888739..030f247 100644 --- a/lib/MC/MCObjectWriter.cpp +++ b/lib/MC/MCObjectWriter.cpp @@ -68,6 +68,8 @@ MCObjectWriter::IsSymbolRefDifferenceFullyResolved(const MCAssembler &Asm, const MCSymbolData &DataA = Asm.getSymbolData(SA); const MCSymbolData &DataB = Asm.getSymbolData(SB); + if(!DataA.getFragment() || !DataB.getFragment()) + return false; return IsSymbolRefDifferenceFullyResolvedImpl(Asm, DataA, *DataB.getFragment(), |