[前][次][番号順一覧][スレッド一覧]

ruby-changes:34441

From: nagachika <ko1@a...>
Date: Tue, 24 Jun 2014 00:08:18 +0900 (JST)
Subject: [ruby-changes:34441] nagachika:r46522 (ruby_2_1): merge revision(s) r45947, r45951: [Backport #9739] [Backport #9844]

nagachika	2014-06-24 00:08:11 +0900 (Tue, 24 Jun 2014)

  New Revision: 46522

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46522

  Log:
    merge revision(s) r45947,r45951: [Backport #9739] [Backport #9844]
    
    * thread_win32.c (rb_w32_stack_overflow_handler): use Structured
      Exception Handling by Addvectoredexceptionhandler() for machine
      stack overflow on mingw.
      This would be equivalent to the handling using __try and __exept
      on mswin introduced by r43748.
      Exception Handling by AddVectoredExceptionHandler() for machine
      This would be equivalent to the handling using __try and __except

  Modified directories:
    branches/ruby_2_1/
  Modified files:
    branches/ruby_2_1/ChangeLog
    branches/ruby_2_1/eval_intern.h
    branches/ruby_2_1/thread_win32.c
    branches/ruby_2_1/version.h
Index: ruby_2_1/eval_intern.h
===================================================================
--- ruby_2_1/eval_intern.h	(revision 46521)
+++ ruby_2_1/eval_intern.h	(revision 46522)
@@ -95,6 +95,15 @@ extern int select_large_fdset(int, fd_se https://github.com/ruby/ruby/blob/trunk/ruby_2_1/eval_intern.h#L95
 	      EXCEPTION_CONTINUE_SEARCH) { \
 	/* never reaches here */ \
     }
+#elif defined(__MINGW32__)
+LONG WINAPI rb_w32_stack_overflow_handler(struct _EXCEPTION_POINTERS *);
+#define SAVE_ROOT_JMPBUF_BEFORE_STMT \
+    do { \
+	PVOID _handler = AddVectoredExceptionHandler(1, rb_w32_stack_overflow_handler);
+
+#define SAVE_ROOT_JMPBUF_AFTER_STMT \
+	RemoveVectoredExceptionHandler(_handler); \
+    } while (0);
 #else
 #define SAVE_ROOT_JMPBUF_BEFORE_STMT
 #define SAVE_ROOT_JMPBUF_AFTER_STMT
Index: ruby_2_1/thread_win32.c
===================================================================
--- ruby_2_1/thread_win32.c	(revision 46521)
+++ ruby_2_1/thread_win32.c	(revision 46522)
@@ -754,6 +754,18 @@ ruby_stack_overflowed_p(const rb_thread_ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/thread_win32.c#L754
     return rb_thread_raised_p(th, RAISED_STACKOVERFLOW);
 }
 
+#if defined(__MINGW32__)
+LONG WINAPI
+rb_w32_stack_overflow_handler(struct _EXCEPTION_POINTERS *exception)
+{
+    if (exception->ExceptionRecord->ExceptionCode == EXCEPTION_STACK_OVERFLOW) {
+	rb_thread_raised_set(GET_THREAD(), RAISED_STACKOVERFLOW);
+	raise(SIGSEGV);
+    }
+    return EXCEPTION_CONTINUE_SEARCH;
+}
+#endif
+
 #ifdef RUBY_ALLOCA_CHKSTK
 void
 ruby_alloca_chkstk(size_t len, void *sp)
Index: ruby_2_1/ChangeLog
===================================================================
--- ruby_2_1/ChangeLog	(revision 46521)
+++ ruby_2_1/ChangeLog	(revision 46522)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1
+Tue Jun 24 00:06:41 2014  Hiroshi Shirosaki  <h.shirosaki@g...>
+
+	* thread_win32.c (rb_w32_stack_overflow_handler): use Structured
+	  Exception Handling by AddVectoredExceptionHandler() for machine
+	  stack overflow on mingw.
+	  This would be equivalent to the handling using __try and __except
+	  on mswin introduced by r43748.
+
 Mon Jun 23 23:56:54 2014  Eric Wong  <e@8...>
 
 	* signal.c (signal_exec): ignore immediate cmd for SIG_IGN
Index: ruby_2_1/version.h
===================================================================
--- ruby_2_1/version.h	(revision 46521)
+++ ruby_2_1/version.h	(revision 46522)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1
 #define RUBY_VERSION "2.1.2"
 #define RUBY_RELEASE_DATE "2014-06-24"
-#define RUBY_PATCHLEVEL 138
+#define RUBY_PATCHLEVEL 139
 
 #define RUBY_RELEASE_YEAR 2014
 #define RUBY_RELEASE_MONTH 6

Property changes on: ruby_2_1
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r45947,45951


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]