[MachO] Fix LC_DYSYMTAB validation for external symbols
We were validating the same index (ilocalsym) twice, while iextdefsym
was never validated.
llvm-svn: 341378
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp
index e422903..76480b4 100644
--- a/llvm/lib/Object/MachOObjectFile.cpp
+++ b/llvm/lib/Object/MachOObjectFile.cpp
@@ -1592,7 +1592,7 @@
"command extends past the end of the symbol table");
return;
}
- if (Dysymtab.nextdefsym != 0 && Dysymtab.ilocalsym > Symtab.nsyms) {
+ if (Dysymtab.nextdefsym != 0 && Dysymtab.iextdefsym > Symtab.nsyms) {
Err = malformedError("nextdefsym in LC_DYSYMTAB load command "
"extends past the end of the symbol table");
return;