[llvm-objcopy] [COFF] Fix warnings abuilt missing field initialization. NFC.

llvm-svn: 350898
This commit is contained in:
Martin Storsjo 2019-01-10 21:59:41 +00:00
parent a112e209cc
commit c54b9bd756
2 changed files with 4 additions and 1 deletions

View File

@ -25,6 +25,9 @@ namespace objcopy {
namespace coff {
struct Relocation {
Relocation() {}
Relocation(const object::coff_relocation& R) : Reloc(R) {}
object::coff_relocation Reloc;
size_t Target;
StringRef TargetName; // Used for diagnostics only

View File

@ -73,7 +73,7 @@ Error COFFReader::readSections(Object &Obj) const {
return errorCodeToError(EC);
ArrayRef<coff_relocation> Relocs = COFFObj.getRelocations(Sec);
for (const coff_relocation &R : Relocs)
S.Relocs.push_back(Relocation{R});
S.Relocs.push_back(R);
if (auto EC = COFFObj.getSectionName(Sec, S.Name))
return errorCodeToError(EC);
if (Sec->hasExtendedRelocations())