[PATCH] D38401: [ELF] Fix incorrect exit status bug exposed by D38283

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 29 12:42:01 PDT 2017


ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: ELF/Writer.cpp:247-250
   if (auto EC = Buffer->commit())
     error("failed to write to the output file: " + EC.message());
+  if (ErrorCount)
+    return;
----------------
error indeed increments ErrorCount, but the code seems to be unnecessarily indirect. I think I prefer

  if (auto EC = Buffer->commit()) {
    error(...);
    return;
  }


https://reviews.llvm.org/D38401





More information about the llvm-commits mailing list