]> granicus.if.org Git - llvm/commitdiff
[codeview] Fully initialize DataSym when mapping from YAML
authorReid Kleckner <rnk@google.com>
Tue, 20 Jun 2017 20:34:37 +0000 (20:34 +0000)
committerReid Kleckner <rnk@google.com>
Tue, 20 Jun 2017 20:34:37 +0000 (20:34 +0000)
In the object file, the section index and relative offset are typically
zero, so make these YAML fields optional with a default.

It looks like there may be more partially initialized symbol records,
but this should fix the msan bot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305842 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ObjectYAML/CodeViewYAMLSymbols.cpp

index 2f78676c6c879ebc7b6191dd055fc36bb0f15f04..edabe415fd0366ec5f0e77ada4ca0e3c3177d1d7 100644 (file)
@@ -489,6 +489,8 @@ template <> void SymbolRecordImpl<ConstantSym>::map(IO &IO) {
 template <> void SymbolRecordImpl<DataSym>::map(IO &IO) {
   // TODO: Map linkage name
   IO.mapRequired("Type", Symbol.Type);
+  IO.mapOptional("DataOffset", Symbol.DataOffset, 0U);
+  IO.mapOptional("Segment", Symbol.Segment, uint16_t(0));
   IO.mapRequired("DisplayName", Symbol.Name);
 }