diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-09 05:56:00 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-09 05:56:00 +0000 |
commit | 3923d7f420d1cbcad2b7fd781ffeb389d3151d07 (patch) | |
tree | 24c719859351e4aa9f0dedb644af91cba330c235 /insnhelper.ci | |
parent | 3a8f7f1d7f3f1b66f47c37b230bc9c53cbdae250 (diff) | |
download | ruby-3923d7f420d1cbcad2b7fd781ffeb389d3151d07.tar.gz |
* vm.c (rb_thread_mark): use rb_gc_mark_maybe() for
VM stack specified by mark_stack_len.
* insnhelper.ci: clear vm stack extended by opt value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'insnhelper.ci')
-rw-r--r-- | insnhelper.ci | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/insnhelper.ci b/insnhelper.ci index 4cc916f102..f7a3a0c3d2 100644 --- a/insnhelper.ci +++ b/insnhelper.ci @@ -114,6 +114,7 @@ vm_callee_setup_arg(rb_thread_t *th, rb_iseq_t *iseq, else { VALUE * const dst = argv; int opt_pc = 0; + th->mark_stack_len = iseq->arg_size; /* mandatory */ @@ -152,6 +153,10 @@ vm_callee_setup_arg(rb_thread_t *th, rb_iseq_t *iseq, opt_pc = iseq->arg_opt_table[opts]; /* no opt */ } else { + int i; + for (i = argc; i<opts; i++) { + dst[i + m] = Qnil; + } opt_pc = iseq->arg_opt_table[argc]; argc = 0; } @@ -190,6 +195,7 @@ vm_callee_setup_arg(rb_thread_t *th, rb_iseq_t *iseq, dst[iseq->arg_block] = blockval; /* Proc or nil */ } + th->mark_stack_len = 0; return opt_pc; } @@ -423,14 +429,13 @@ vm_setup_method(rb_thread_t *th, rb_control_frame_t *cfp, { rb_iseq_t *iseq; int opt_pc, i; - VALUE *rsp = cfp->sp - argc; - VALUE *sp; + VALUE *sp, *rsp = cfp->sp - argc; /* TODO: eliminate it */ GetISeqPtr(iseqval, iseq); + sp = rsp + iseq->arg_size; opt_pc = vm_callee_setup_arg(th, iseq, argc, rsp, &blockptr); - sp = rsp + iseq->arg_size; /* stack overflow check */ CHECK_STACK_OVERFLOW(cfp, iseq->stack_max + 0x10); @@ -778,7 +783,6 @@ vm_yield_setup_args(rb_thread_t *th, rb_iseq_t *iseq, } argv[iseq->arg_block] = procval; - th->mark_stack_len = iseq->arg_block + 1; } th->mark_stack_len = 0; |