Skip to content

Commit

Permalink
llvm: fix -Wcast gcc warn error from rL308329
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308360 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
martell committed Jul 18, 2017
1 parent 5212269 commit 6bad828
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/Object/COFFImportFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,18 +539,15 @@ NewArchiveMember ObjectFactory::createWeakExternal(StringRef Sym,
1},
{{{2, 0, 0, 0, 3, 0, 0, 0}}, u32(0), u16(0), u16(0), uint8_t(0), 0},
};
reinterpret_cast<StringTableOffset &>(SymbolTable[2].Name).Offset =
sizeof(uint32_t);
SymbolTable[2].Name.Offset.Offset = sizeof(uint32_t);

//__imp_ String Table
if (Imp) {
reinterpret_cast<StringTableOffset &>(SymbolTable[3].Name).Offset =
sizeof(uint32_t) + Sym.size() + 1 + 6;
SymbolTable[3].Name.Offset.Offset = sizeof(uint32_t) + Sym.size() + 7;
writeStringTable(Buffer, {std::string("__imp_").append(Sym),
std::string("__imp_").append(Weak)});
} else {
reinterpret_cast<StringTableOffset &>(SymbolTable[3].Name).Offset =
sizeof(uint32_t) + Sym.size() + 1;
SymbolTable[3].Name.Offset.Offset = sizeof(uint32_t) + Sym.size() + 1;
writeStringTable(Buffer, {Sym, Weak});
}
append(Buffer, SymbolTable);
Expand Down

0 comments on commit 6bad828

Please sign in to comment.