Reviewers: Yang,

Message:
Original CL http://codereview.chromium.org/9601002/ by Jonathan Liu
<[email protected]>. Added cosmetic changes.

LGTM, tested and landing.

Description:
Simplify silent abort by raising SIGABRT directly.


Please review this at http://codereview.chromium.org/9597012/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/platform-win32.cc
  M src/win32-headers.h


Index: src/platform-win32.cc
diff --git a/src/platform-win32.cc b/src/platform-win32.cc
index 064a449e07a62dd5c4459b4f257b498d8219e627..53915c6c0e426e73079a64caeec06a44c0798993 100644
--- a/src/platform-win32.cc
+++ b/src/platform-win32.cc
@@ -967,12 +967,8 @@ void OS::Sleep(int milliseconds) {

 void OS::Abort() {
   if (!IsDebuggerPresent()) {
-#ifdef _MSC_VER
     // Make the MSVCRT do a silent abort.
-    _set_abort_behavior(0, _WRITE_ABORT_MSG);
-    _set_abort_behavior(0, _CALL_REPORTFAULT);
-#endif  // _MSC_VER
-    abort();
+    raise(SIGABRT);
   } else {
     DebugBreak();
   }
Index: src/win32-headers.h
diff --git a/src/win32-headers.h b/src/win32-headers.h
index 87f078dc0ca4f45e99db0a11a4aa143c81a5e029..5d9c89e3121cb858bbbfb56d72b107e1fa7e4b82 100644
--- a/src/win32-headers.h
+++ b/src/win32-headers.h
@@ -56,6 +56,7 @@
 #include <windows.h>

 #ifdef V8_WIN32_HEADERS_FULL
+#include <signal.h>  // For raise().
 #include <time.h>  // For LocalOffset() implementation.
 #include <mmsystem.h>  // For timeGetTime().
 #ifdef __MINGW32__
@@ -78,7 +79,7 @@
 #ifndef __MINGW32__
 #include <wspiapi.h>
 #endif  // __MINGW32__
-#include <process.h>  // for _beginthreadex()
+#include <process.h>  // For _beginthreadex().
 #include <stdlib.h>
 #endif  // V8_WIN32_HEADERS_FULL



--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to