[MachOObject] Fix bind opcode parser error on valid opcode sequence

BIND_OPCODE_SET_DYLIB_SPECIAL_IMM(0) is a valid way to setp library
ordinal. MachOObject should set LibraryOrdinalSet even when IMM is zero.

llvm-svn: 304362
This commit is contained in:
Steven Wu 2017-05-31 22:17:43 +00:00
parent 244621faad
commit 97e2cf87e1
1 changed files with 1 additions and 1 deletions

View File

@ -3269,7 +3269,6 @@ void MachOBindEntry::moveNext() {
if (ImmValue) {
SignExtended = MachO::BIND_OPCODE_MASK | ImmValue;
Ordinal = SignExtended;
LibraryOrdinalSet = true;
if (Ordinal < MachO::BIND_SPECIAL_DYLIB_FLAT_LOOKUP) {
*E = malformedError("for BIND_OPCODE_SET_DYLIB_SPECIAL_IMM unknown "
"special ordinal: " + Twine((int)Ordinal) + " for opcode at: "
@ -3279,6 +3278,7 @@ void MachOBindEntry::moveNext() {
}
} else
Ordinal = 0;
LibraryOrdinalSet = true;
DEBUG_WITH_TYPE(
"mach-o-bind",
dbgs() << "BIND_OPCODE_SET_DYLIB_SPECIAL_IMM: "