Skip to content

Commit

Permalink
Fix the implementation of MachOObjectFile::isSectionZeroInit so it fo…
Browse files Browse the repository at this point in the history
…llows the MachO spec.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155976 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
eefriedman committed May 2, 2012
1 parent 39cc513 commit 41827f9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/Object/MachOObjectFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -598,13 +598,15 @@ error_code MachOObjectFile::isSectionZeroInit(DataRefImpl DRI,
if (MachOObj->is64Bit()) {
InMemoryStruct<macho::Section64> Sect;
getSection64(DRI, Sect);
Result = (Sect->Flags & MachO::SectionTypeZeroFill ||
Sect->Flags & MachO::SectionTypeZeroFillLarge);
unsigned SectionType = Sect->Flags & MachO::SectionFlagMaskSectionType;
Result = (SectionType == MachO::SectionTypeZeroFill ||
SectionType == MachO::SectionTypeZeroFillLarge);
} else {
InMemoryStruct<macho::Section> Sect;
getSection(DRI, Sect);
Result = (Sect->Flags & MachO::SectionTypeZeroFill ||
Sect->Flags & MachO::SectionTypeZeroFillLarge);
unsigned SectionType = Sect->Flags & MachO::SectionFlagMaskSectionType;
Result = (SectionType == MachO::SectionTypeZeroFill ||
SectionType == MachO::SectionTypeZeroFillLarge);
}

return object_error::success;
Expand Down

0 comments on commit 41827f9

Please sign in to comment.