Skip to content

Commit 702e431

Browse files
committed
* cont.c (rb_fiber_s_new), yarvcore.c (th_init2): fix to clear
VM stack ([ruby-dev:31046]). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 0043929 commit 702e431

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Tue Jun 26 03:38:31 2007 Koichi Sasada <[email protected]>
2+
3+
* cont.c (rb_fiber_s_new), yarvcore.c (th_init2): fix to clear
4+
VM stack ([ruby-dev:31046]).
5+
16
Tue Jun 26 03:15:27 2007 Koichi Sasada <[email protected]>
27

38
* compile.c: rename setup_arg() to setup_args().

cont.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,8 @@ rb_fiber_s_new(VALUE self)
474474
th->stack = 0;
475475
th->stack_size = FIBER_STACK_SIZE;
476476
th->stack = ALLOC_N(VALUE, th->stack_size);
477+
MEMZERO(th->stack, VALUE, th->stack_size);
478+
477479
th->cfp = (void *)(th->stack + th->stack_size);
478480
th->cfp--;
479481
th->cfp->pc = 0;

yarvcore.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,10 @@ th_init2(rb_thread_t *th)
327327
MEMZERO(th, rb_thread_t, 1);
328328

329329
/* allocate thread stack */
330-
th->stack = ALLOC_N(VALUE, RUBY_VM_THREAD_STACK_SIZE);
331-
332330
th->stack_size = RUBY_VM_THREAD_STACK_SIZE;
331+
th->stack = ALLOC_N(VALUE, th->stack_size);
332+
MEMZERO(th->stack, VALUE, th->stack_size);
333+
333334
th->cfp = (void *)(th->stack + th->stack_size);
334335
th->cfp--;
335336

0 commit comments

Comments
 (0)