[yaml2obj][ELF] Ensure more fields are zero'd.

I was spotting garbage in the output. I'd like to just zero the entire
ELFYAML::Section to be sure, but it contains non-POD types. (I'm also
trying to avoid bloating the ELFYAML::Foo classes with a bunch of
constructor code).

No test, since this is by its very nature unpredictable. I'm pretty sure
that one of the sanitizers would catch it immediately though.

llvm-svn: 184160
This commit is contained in:
Sean Silva 2013-06-18 01:11:21 +00:00
parent cd3523c12d
commit f62a6005f3
1 changed files with 2 additions and 0 deletions

View File

@ -160,6 +160,8 @@ static int writeELF(raw_ostream &OS, const ELFYAML::Object &Doc) {
ELFYAML::Section S;
S.Type = SHT_NULL;
zero(S.Flags);
zero(S.Address);
zero(S.AddressAlign);
Sections.insert(Sections.begin(), S);
}
// "+ 1" for string table.