Add missing error checking code intended for r347687
authorReid Kleckner <rnk@google.com>
Tue, 27 Nov 2018 19:14:11 +0000 (19:14 +0000)
committerReid Kleckner <rnk@google.com>
Tue, 27 Nov 2018 19:14:11 +0000 (19:14 +0000)
llvm-svn: 347690

llvm/lib/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.cpp

index 12df042..ab93efc 100644 (file)
@@ -154,8 +154,10 @@ Error DbiModuleDescriptorBuilder::commit(BinaryStreamWriter &ModiWriter,
     if (auto EC =
             SymbolWriter.writeInteger<uint32_t>(COFF::DEBUG_SECTION_MAGIC))
       return EC;
-    for (ArrayRef<uint8_t> Syms : Symbols)
-      SymbolWriter.writeBytes(Syms);
+    for (ArrayRef<uint8_t> Syms : Symbols) {
+      if (auto EC = SymbolWriter.writeBytes(Syms))
+        return EC;
+    }
     assert(SymbolWriter.getOffset() % alignOf(CodeViewContainer::Pdb) == 0 &&
            "Invalid debug section alignment!");
     // TODO: Write C11 Line data