aboutsummaryrefslogtreecommitdiffstats
path: root/lib/System
diff options
context:
space:
mode:
authorJeff Cohen <jeffc@jolt-lang.org>2005-08-02 03:26:32 +0000
committerJeff Cohen <jeffc@jolt-lang.org>2005-08-02 03:26:32 +0000
commit64fe58490d28b7f7ba3ecb78fd9290688ded8f0c (patch)
treed71675bf0714abaa4048dad4ad6252009ebfb59d /lib/System
parent1593ac259db20a5ed71b241c5e9c2796f5d34044 (diff)
downloadexternal_llvm-64fe58490d28b7f7ba3ecb78fd9290688ded8f0c.zip
external_llvm-64fe58490d28b7f7ba3ecb78fd9290688ded8f0c.tar.gz
external_llvm-64fe58490d28b7f7ba3ecb78fd9290688ded8f0c.tar.bz2
It's dangerous coding on Mondays.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22585 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System')
-rw-r--r--lib/System/Win32/Signals.inc13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/System/Win32/Signals.inc b/lib/System/Win32/Signals.inc
index cf5cb40..333e387 100644
--- a/lib/System/Win32/Signals.inc
+++ b/lib/System/Win32/Signals.inc
@@ -114,8 +114,8 @@ void sys::PrintStackTraceOnErrorSignal() {
void sys::SetInterruptFunction(void (*IF)()) {
- InterruptFunction = IF;
RegisterHandler();
+ InterruptFunction = IF;
LeaveCriticalSection(&CriticalSection);
}
}
@@ -239,6 +239,7 @@ static LONG WINAPI LLVMUnhandledExceptionFilter(LPEXCEPTION_POINTERS ep) {
}
static BOOL WINAPI LLVMConsoleCtrlHandler(DWORD dwCtrlType) {
+ // We are running in our very own thread, courtesy of Windows.
EnterCriticalSection(&CriticalSection);
Cleanup();
@@ -248,13 +249,9 @@ static BOOL WINAPI LLVMConsoleCtrlHandler(DWORD dwCtrlType) {
InterruptFunction = 0; // Don't run it on another CTRL-C.
if (IF) {
- try {
- IF(); // Run it now.
- } catch (...) {
- // Kill the process on an exception.
- LeaveCriticalSection(&CriticalSection);
- return FALSE;
- }
+ // Note: if the interrupt function throws an exception, there is nothing
+ // to catch it in this thread so it will kill the process.
+ IF(); // Run it now.
LeaveCriticalSection(&CriticalSection);
return TRUE; // Don't kill the process.
}