blob: 147f88af72ae314cc83e6a96a7b93bb63231e9cb [file] [log] [blame]
--- lld/Common/ErrorHandler.cpp.orig 2020-11-02 22:36:38.711080500 -0800
+++ lld/Common/ErrorHandler.cpp 2020-11-02 22:36:45.429829700 -0800
@@ -21,6 +21,10 @@
#include <mutex>
#include <regex>
+#ifdef _WIN32
+#include <processthreadsapi.h>
+#endif
+
using namespace llvm;
using namespace lld;
@@ -80,6 +84,9 @@
lld::outs().flush();
lld::errs().flush();
}
+#ifdef _WIN32
+ TerminateProcess(GetCurrentProcess(), val);
+#endif
// When running inside safeLldMain(), restore the control flow back to the
// CrashRecoveryContext. Otherwise simply use _exit(), meanning no cleanup,
// since we want to avoid further crashes on shutdown.