summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-21 09:16:58 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-21 09:16:58 +0000
commit341c1cb7f8917838da788ef35dab6a65bce55cff (patch)
tree3874d2a724d54638a63f60a459440a31ca16a0e0
parentc2d571c37feb7b9f35e4653717422ae79b13312c (diff)
merges r23720 from trunk into ruby_1_9_1.
-- * thread.c (ruby_thread_stack_overflow): call rb_exc_raise() on stack overflows in the signal handler, if sigaltstack is available. On stack overflow (and with sigaltstack), the signal handler is more likely to have room to create an exception object. [ruby-core:23813] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@23794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--thread.c11
-rw-r--r--version.h2
3 files changed, 19 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 97a1832b85..c077dbb557 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Wed Jun 17 12:37:37 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * thread.c (ruby_thread_stack_overflow): call rb_exc_raise() on
+ stack overflows in the signal handler, if sigaltstack is
+ available. On stack overflow (and with sigaltstack), the signal
+ handler is more likely to have room to create an exception
+ object. [ruby-core:23813]
+
Wed Jun 17 08:14:01 2009 Tadayoshi Funaba <tadf@dotrb.org>
* complex.c (nucomp_coerce): accepts Complex instances.
diff --git a/thread.c b/thread.c
index fce974acf4..91b957681d 100644
--- a/thread.c
+++ b/thread.c
@@ -1302,12 +1302,21 @@ rb_thread_signal_exit(void *thptr)
rb_thread_raise(2, argv, th->vm->main_thread);
}
+#if defined(POSIX_SIGNAL) && defined(SIGSEGV) && defined(HAVE_SIGALTSTACK)
+#define USE_SIGALTSTACK
+#endif
+
void
ruby_thread_stack_overflow(rb_thread_t *th)
{
- th->errinfo = sysstack_error;
th->raised_flag = 0;
+#ifdef USE_SIGALTSTACK
+ th->raised_flag = 0;
+ rb_exc_raise(sysstack_error);
+#else
+ th->errinfo = sysstack_error;
TH_JUMP_TAG(th, TAG_RAISE);
+#endif
}
int
diff --git a/version.h b/version.h
index 05177b29ac..4c82915df3 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "1.9.1"
#define RUBY_RELEASE_DATE "2009-05-22"
-#define RUBY_PATCHLEVEL 184
+#define RUBY_PATCHLEVEL 185
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 9
#define RUBY_VERSION_TEENY 1