diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-08 04:05:59 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-08 04:05:59 +0000 |
commit | 893ee3097885c83df17273d7de5ed54438de5d20 (patch) | |
tree | c1808c71a82b5ce53683afd00c65b95accca952a /compile.c | |
parent | 6a1a57d13b4358f718a3b5037cefd2d00bbb48d2 (diff) | |
download | ruby-893ee3097885c83df17273d7de5ed54438de5d20.tar.gz |
* compile.c (iseq_build_from_ary), iseq.c (iseq_load): fix for format change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -4831,7 +4831,7 @@ iseq_build_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor, #define CHECK_ARRAY(v) rb_convert_type(v, T_ARRAY, "Array", "to_ary") #define CHECK_STRING(v) rb_convert_type(v, T_STRING, "String", "to_str") #define CHECK_SYMBOL(v) rb_convert_type(v, T_SYMBOL, "Symbol", "to_sym") -#define CHECK_INTEGER(v) (NUM2LONG(v), v) +static inline VALUE CHECK_INTEGER(VALUE v) {NUM2LONG(v); return v;} VALUE iseq_build_from_ary(rb_iseq_t *iseq, VALUE locals, VALUE args, @@ -4868,20 +4868,19 @@ iseq_build_from_ary(rb_iseq_t *iseq, VALUE locals, VALUE args, else { int i = 0; VALUE argc = CHECK_INTEGER(rb_ary_entry(args, i++)); - VALUE arg_opts = CHECK_INTEGER(rb_ary_entry(args, i++)); VALUE arg_opt_labels = CHECK_ARRAY(rb_ary_entry(args, i++)); VALUE arg_post_len = CHECK_INTEGER(rb_ary_entry(args, i++)); VALUE arg_post_start = CHECK_INTEGER(rb_ary_entry(args, i++)); VALUE arg_rest = CHECK_INTEGER(rb_ary_entry(args, i++)); VALUE arg_block = CHECK_INTEGER(rb_ary_entry(args, i++)); + VALUE arg_simple = CHECK_INTEGER(rb_ary_entry(args, i++)); iseq->argc = FIX2INT(argc); - iseq->arg_opts = FIX2INT(arg_opts); iseq->arg_rest = FIX2INT(arg_rest); iseq->arg_post_len = FIX2INT(arg_post_len); iseq->arg_post_start = FIX2INT(arg_post_start); iseq->arg_block = FIX2INT(arg_block); - iseq->arg_opt_table = (VALUE *)ALLOC_N(VALUE, iseq->arg_opts); + iseq->arg_opt_table = (VALUE *)ALLOC_N(VALUE, RARRAY_LEN(arg_opt_labels)); if (iseq->arg_block != -1) { iseq->arg_size = iseq->arg_block + 1; @@ -4901,6 +4900,8 @@ iseq_build_from_ary(rb_iseq_t *iseq, VALUE locals, VALUE args, (VALUE)register_label(iseq, labels_table, rb_ary_entry(arg_opt_labels, i)); } + + iseq->arg_simple = NUM2INT(arg_simple); } /* exception */ |