[llvm] r210895 - [Win32] Let utils/not aware of abort(), aka llvm_unreachable(), in msvcrt.

NAKAMURA Takumi geek4civic at gmail.com
Fri Jun 13 05:23:57 PDT 2014


Author: chapuni
Date: Fri Jun 13 07:23:56 2014
New Revision: 210895

URL: http://llvm.org/viewvc/llvm-project?rev=210895&view=rev
Log:
[Win32] Let utils/not aware of abort(), aka llvm_unreachable(), in msvcrt.

It has exit code as 3. abort(), aka unreachable, may be handled as crash.

FIXME: Could we move this into Win32/Program.inc?

Modified:
    llvm/trunk/utils/not/not.cpp

Modified: llvm/trunk/utils/not/not.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/not/not.cpp?rev=210895&r1=210894&r2=210895&view=diff
==============================================================================
--- llvm/trunk/utils/not/not.cpp (original)
+++ llvm/trunk/utils/not/not.cpp Fri Jun 13 07:23:56 2014
@@ -32,6 +32,13 @@ int main(int argc, const char **argv) {
   std::string ErrMsg;
   int Result = sys::ExecuteAndWait(Program, argv, nullptr, nullptr, 0, 0,
                                    &ErrMsg);
+#ifdef _WIN32
+  // Handle abort() in msvcrt -- It has exit code as 3.
+  // abort(), aka unreachable, may be handled as crash.
+  // FIXME: Could we move this into Win32/Program.inc?
+  if (Result == 3)
+    Result = -3;
+#endif
   if (Result < 0) {
     errs() << "Error: " << ErrMsg << "\n";
     if (ExpectCrash)





More information about the llvm-commits mailing list