1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* iseq.c (simple_default_value): removed. default values of optional

parameters are not available still now.  [ruby-dev:37980]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-02-13 06:34:20 +00:00
parent 0cb68b619e
commit a14bd973ed
2 changed files with 5 additions and 35 deletions

View file

@ -1,3 +1,8 @@
Fri Feb 13 15:34:18 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* iseq.c (simple_default_value): removed. default values of optional
parameters are not available still now. [ruby-dev:37980]
Fri Feb 13 15:11:11 2009 Koichi Sasada <ko1@atdot.net>
* vm_eval.c (eval_string_with_cref): use rb_vm_get_ruby_level_next_cfp()

35
iseq.c
View file

@ -1284,38 +1284,6 @@ rb_iseq_clone(VALUE iseqval, VALUE newcbase)
return newiseq;
}
static VALUE
simple_default_value(const VALUE *seq, const VALUE *eseq)
{
VALUE val;
again:
switch (*seq++) {
case BIN(trace):
if (++seq >= eseq) return Qundef;
goto again;
case BIN(putnil):
val = Qnil;
goto got;
case BIN(putstring):
val = rb_str_new3(*seq++);
goto got;
case BIN(putobject):
val = *seq++;
got:
switch (*seq++) {
case BIN(setlocal):
if ((seq+=1) == eseq) return val;
break;
case BIN(setdynamic):
if ((seq+=2) == eseq) return val;
break;
}
default:
return Qundef;
}
}
VALUE
rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc)
{
@ -1352,10 +1320,7 @@ rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc)
for (s = i; i < r; i++) {
PARAM_TYPE(opt);
if (rb_id2name(PARAM_ID(i))) {
VALUE defval = simple_default_value(iseq->iseq + iseq->arg_opt_table[i-s],
iseq->iseq + iseq->arg_opt_table[i-s+1]);
rb_ary_push(a, ID2SYM(PARAM_ID(i)));
if (defval != Qundef) rb_ary_push(a, defval);
}
rb_ary_push(args, a);
}