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 + + * 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 * 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