Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: runtime/bin/platform_win.cc

Issue 2981773002: [Windows] Turn off TLS destructors in the Platform exception handler (Closed)
Patch Set: Fix error code type Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(HOST_OS_WINDOWS) 6 #if defined(HOST_OS_WINDOWS)
7 7
8 #include "bin/platform.h" 8 #include "bin/platform.h"
9 9
10 #include <crtdbg.h> 10 #include <crtdbg.h>
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 RestoreConsoleLocked(); 110 RestoreConsoleLocked();
111 } 111 }
112 112
113 // Windows top-level unhandled exception handler function. 113 // Windows top-level unhandled exception handler function.
114 // See MSDN documentation for UnhandledExceptionFilter. 114 // See MSDN documentation for UnhandledExceptionFilter.
115 // https://msdn.microsoft.com/en-us/library/windows/desktop/ms681401(v=vs.85). aspx 115 // https://msdn.microsoft.com/en-us/library/windows/desktop/ms681401(v=vs.85). aspx
116 static LONG WINAPI 116 static LONG WINAPI
117 DartExceptionHandler(struct _EXCEPTION_POINTERS* ExceptionInfo) { 117 DartExceptionHandler(struct _EXCEPTION_POINTERS* ExceptionInfo) {
118 if (ExceptionInfo->ExceptionRecord->ExceptionCode == 118 if (ExceptionInfo->ExceptionRecord->ExceptionCode ==
119 EXCEPTION_ACCESS_VIOLATION) { 119 EXCEPTION_ACCESS_VIOLATION) {
120 const int kAbortExitCode = 3;
120 Dart_DumpNativeStackTrace(ExceptionInfo->ContextRecord); 121 Dart_DumpNativeStackTrace(ExceptionInfo->ContextRecord);
121 RestoreConsole(); 122 Platform::Exit(kAbortExitCode);
122 abort();
123 } 123 }
124 return EXCEPTION_CONTINUE_SEARCH; 124 return EXCEPTION_CONTINUE_SEARCH;
125 } 125 }
126 126
127 static void SetExceptionHandler() { 127 static void SetExceptionHandler() {
128 SetUnhandledExceptionFilter(DartExceptionHandler); 128 SetUnhandledExceptionFilter(DartExceptionHandler);
129 } 129 }
130 130
131 private: 131 private:
132 static Mutex* platform_win_mutex_; 132 static Mutex* platform_win_mutex_;
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 PlatformWin::RestoreConsole(); 304 PlatformWin::RestoreConsole();
305 // On Windows we use ExitProcess so that threads can't clobber the exit_code. 305 // On Windows we use ExitProcess so that threads can't clobber the exit_code.
306 // See: https://code.google.com/p/nativeclient/issues/detail?id=2870 306 // See: https://code.google.com/p/nativeclient/issues/detail?id=2870
307 ::ExitProcess(exit_code); 307 ::ExitProcess(exit_code);
308 } 308 }
309 309
310 } // namespace bin 310 } // namespace bin
311 } // namespace dart 311 } // namespace dart
312 312
313 #endif // defined(HOST_OS_WINDOWS) 313 #endif // defined(HOST_OS_WINDOWS)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698