summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-29 12:19:39 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-29 12:19:39 +0000
commitbdaaae417ae26594ca04956704a132c5012da4c9 (patch)
tree65f1bcc8d06d5c3dd252348ebcf704f8540012ec
parent1c8167781fcc8fe306e313bb174602d9d60b6da7 (diff)
downloadruby-bdaaae417ae26594ca04956704a132c5012da4c9.tar.gz
stack_extend
* eval.c (stack_extend): prevent ALLOCA_N, which reserves a memory space with for restoring machine stack stored in each threads, from optimization out. backport r34278 from the trunk. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@36251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--eval.c2
2 files changed, 8 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 2601f0e3d5..a7d903f4b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Jun 29 21:19:36 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (stack_extend): prevent ALLOCA_N, which reserves a memory
+ space with for restoring machine stack stored in each threads, from
+ optimization out. backport r34278 from the trunk.
+
Mon May 21 16:29:47 2012 Akinori MUSHA <knu@iDaemons.org>
* ext/syslog/syslog.c (mSyslog_inspect): Make sure self is a
diff --git a/eval.c b/eval.c
index 4d0990a54c..3ea45d6bc0 100644
--- a/eval.c
+++ b/eval.c
@@ -11040,6 +11040,7 @@ stack_extend(rb_thread_t th, int exit)
if (space > th->stk_pos) {
# ifdef HAVE_ALLOCA
sp = ALLOCA_N(VALUE, &space[0] - th->stk_pos);
+ space[0] = *sp;
# else
stack_extend(th, exit);
# endif
@@ -11054,6 +11055,7 @@ stack_extend(rb_thread_t th, int exit)
if (&space[STACK_PAD_SIZE] < th->stk_pos + th->stk_len) {
# ifdef HAVE_ALLOCA
sp = ALLOCA_N(VALUE, th->stk_pos + th->stk_len - &space[STACK_PAD_SIZE]);
+ space[0] = *sp;
# else
stack_extend(th, exit);
# endif