summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit9aafa06befea616f07d8e955660e0a7eb5425527 (patch)
tree33bdfb3ed78d489d28515cc6e25c3a70003dc4e4 /llvm/lib/System
parent4fd3e16cbdc63647aed847b0ff18c56a3caec02b (diff)
downloadbcm5719-llvm-9aafa06befea616f07d8e955660e0a7eb5425527.tar.gz
bcm5719-llvm-9aafa06befea616f07d8e955660e0a7eb5425527.zip
It's dangerous coding on Mondays.
llvm-svn: 22585
Diffstat (limited to 'llvm/lib/System')
-rw-r--r--llvm/lib/System/Win32/Signals.inc13
1 files changed, 5 insertions, 8 deletions
diff --git a/llvm/lib/System/Win32/Signals.inc b/llvm/lib/System/Win32/Signals.inc
index cf5cb40d4d0..333e387dea1 100644
--- a/llvm/lib/System/Win32/Signals.inc
+++ b/llvm/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.
}
OpenPOWER on IntegriCloud