[PATCH] D66491: [COFF] Check errorCount before committing the output file

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 20 14:11:36 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL369445: [COFF] Check errorCount before committing the output file (authored by mstorsjo, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D66491?vs=216210&id=216248#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66491/new/

https://reviews.llvm.org/D66491

Files:
  lld/trunk/COFF/Writer.cpp
  lld/trunk/test/COFF/multiple-resource-objs.test


Index: lld/trunk/test/COFF/multiple-resource-objs.test
===================================================================
--- lld/trunk/test/COFF/multiple-resource-objs.test
+++ lld/trunk/test/COFF/multiple-resource-objs.test
@@ -1,7 +1,9 @@
 # RUN: llvm-cvtres /out:%t_resource.obj %S/Inputs/resource.res
 # RUN: llvm-cvtres /out:%t_id.obj %S/Inputs/id.res
+# RUN: rm -f %t.exe
 # RUN: not lld-link /out:%t.exe /dll /noentry %t_id.obj %t_resource.obj 2>&1 | \
 # RUN:     FileCheck --check-prefix=TWOOBJ %s
+# RUN: not test -f %t.exe
 
 TWOOBJ: error: {{.*}}_resource.obj: more than one resource obj file not allowed, already got {{.*}}_id.obj
 
Index: lld/trunk/COFF/Writer.cpp
===================================================================
--- lld/trunk/COFF/Writer.cpp
+++ lld/trunk/COFF/Writer.cpp
@@ -628,6 +628,9 @@
 
   writeMapFile(outputSections);
 
+  if (errorCount())
+    return;
+
   ScopedTimer t2(diskCommitTimer);
   if (auto e = buffer->commit())
     fatal("failed to write the output file: " + toString(std::move(e)));


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66491.216248.patch
Type: text/x-patch
Size: 1046 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190820/1d0de61f/attachment.bin>


More information about the llvm-commits mailing list