[PATCH] D68164: [Commandline] Clear error on raw_ostream when there is parsing error.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 30 22:26:49 PDT 2019


ruiu added a comment.

The result of calling exit() more than once is an undefined behavior, so I agree with you that we should avoid that even if that's currently not observable.

Another way of fixing this issue is handling 0, 1 and 2 as special FDs, as they are actually special. If FD is equal or less than 2, we can avoid calling exit even if reading/writing it results in an error. That's perhaps more general way of fixing this issue than clearing an error condition at this particular place, I guess?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68164





More information about the llvm-commits mailing list