Skip to content

Commit 7da1dbb

Browse files
authored
[MachO] Remove redundant bounds check (#100176)
The condition was duplicated, the correct one for this message would have been `ImportsEnd > SymbolsEnd`. However, this is a subset of `ImportEnd > Symbols` (since `Symbols <= SymbolsEnd`), so it can be removed altogether. I made this thinko in 686d8ce. Note that that change wasn't intended to be permanent, and served as a quick stopgap to facilitate testing chained fixups in LLD before Apple upstreamed their implementation. Fixes #90662 Fixes #87203
1 parent 0c31123 commit 7da1dbb

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

llvm/lib/Object/MachOObjectFile.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5193,11 +5193,6 @@ MachOObjectFile::getDyldChainedFixupTargets() const {
51935193
const char *Symbols = Contents + Header.symbols_offset;
51945194
const char *SymbolsEnd = Contents + DyldChainedFixups.datasize;
51955195

5196-
if (ImportsEnd > Symbols)
5197-
return malformedError("bad chained fixups: imports end " +
5198-
Twine(ImportsEndOffset) + " extends past end " +
5199-
Twine(DyldChainedFixups.datasize));
5200-
52015196
if (ImportsEnd > Symbols)
52025197
return malformedError("bad chained fixups: imports end " +
52035198
Twine(ImportsEndOffset) + " overlaps with symbols");

0 commit comments

Comments
 (0)