diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2012-05-02 02:31:28 +0000 |
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2012-05-02 02:31:28 +0000 |
| commit | 4a80e94b86f5f7e8df3e81bebb280444e1c43bbe (patch) | |
| tree | adae06f92ed4774831821fa31663e72dcef045d8 /llvm/lib/Object | |
| parent | 38f7c7bca5469ed62ee4c309f7c2c528eb093b2e (diff) | |
| download | bcm5719-llvm-4a80e94b86f5f7e8df3e81bebb280444e1c43bbe.tar.gz bcm5719-llvm-4a80e94b86f5f7e8df3e81bebb280444e1c43bbe.zip | |
Fix the implementation of MachOObjectFile::isSectionZeroInit so it follows the MachO spec.
llvm-svn: 155976
Diffstat (limited to 'llvm/lib/Object')
| -rw-r--r-- | llvm/lib/Object/MachOObjectFile.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp index 3bcda1700b8..5de945300c6 100644 --- a/llvm/lib/Object/MachOObjectFile.cpp +++ b/llvm/lib/Object/MachOObjectFile.cpp @@ -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; |

