-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[MachO] Remove redundant bounds check #100176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I made this thinko in 686d8ce. Note that that change was never intended to be permanent, and served as a quick stopgap to facilitate testing chained fixups in LLD before Apple upstreamed their implementation. That has not yet happened in the two years since. Fixes llvm#90662 Fixes llvm#87203
@llvm/pr-subscribers-llvm-binary-utilities Author: Daniel Bertalan (BertalanD) ChangesI made this thinko in 686d8ce. Note that that change was never intended to be permanent, and served as a quick stopgap to facilitate testing chained fixups in LLD before Apple upstreamed their implementation. That has not yet happened in the two years since. Fixes #90662 Full diff: https://github.com/llvm/llvm-project/pull/100176.diff 1 Files Affected:
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp
index 812b2c00ba699..2a17b496fd62b 100644
--- a/llvm/lib/Object/MachOObjectFile.cpp
+++ b/llvm/lib/Object/MachOObjectFile.cpp
@@ -5193,7 +5193,7 @@ MachOObjectFile::getDyldChainedFixupTargets() const {
const char *Symbols = Contents + Header.symbols_offset;
const char *SymbolsEnd = Contents + DyldChainedFixups.datasize;
- if (ImportsEnd > Symbols)
+ if (ImportsEnd > SymbolsEnd)
return malformedError("bad chained fixups: imports end " +
Twine(ImportsEndOffset) + " extends past end " +
Twine(DyldChainedFixups.datasize));
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/123/builds/3018 Here is the relevant piece of the build log for the reference:
|
The condition was duplicated, the correct one for this message would have been
ImportsEnd > SymbolsEnd
. However, this is a subset ofImportEnd > Symbols
(sinceSymbols <= 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