summaryrefslogtreecommitdiff
path: root/marshal.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-02-24 14:16:59 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-02-24 14:16:59 +0000
commit6f828a2437d8e5146e44a59108abf8c0f5207ffd (patch)
tree9d40feecffcaacfaeafb21495d7ae7330e2149c3 /marshal.c
parentaba5263254440c57ec11ccb398f77693129f0e88 (diff)
* marshal.c (r_object0): should prepare placeholder before
processing instance variables. [ruby-dev:40414] * marshal.c (id2encidx): no longer need arg. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'marshal.c')
-rw-r--r--marshal.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/marshal.c b/marshal.c
index 1b9e62292c..702dd66357 100644
--- a/marshal.c
+++ b/marshal.c
@@ -1126,7 +1126,7 @@ r_bytes0(long len, struct load_arg *arg)
}
static int
-id2encidx(ID id, VALUE val, struct load_arg *arg)
+id2encidx(ID id, VALUE val)
{
if (id == rb_id_encoding()) {
int idx = rb_enc_find_index(StringValueCStr(val));
@@ -1165,7 +1165,7 @@ r_symreal(struct load_arg *arg, int ivar)
long num = r_long(arg);
while (num-- > 0) {
id = r_symbol(arg);
- idx = id2encidx(id, r_object(arg), arg);
+ idx = id2encidx(id, r_object(arg));
}
}
if (idx < 0) idx = rb_usascii_encindex();
@@ -1266,7 +1266,7 @@ r_ivar(VALUE obj, int *has_encoding, struct load_arg *arg)
do {
ID id = r_symbol(arg);
VALUE val = r_object(arg);
- int idx = id2encidx(id, val, arg);
+ int idx = id2encidx(id, val);
if (idx >= 0) {
rb_enc_associate_index(obj, idx);
if (has_encoding) *has_encoding = TRUE;
@@ -1494,8 +1494,8 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
volatile VALUE str = r_bytes(arg);
int options = r_byte(arg);
int has_encoding = FALSE;
+ st_index_t idx = r_prepare(arg);
- v = r_entry(rb_reg_alloc(), arg);
if (ivp) {
r_ivar(str, &has_encoding, arg);
*ivp = FALSE;
@@ -1519,7 +1519,7 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
}
rb_str_set_len(str, dst - ptr);
}
- v = rb_reg_init_str(v, str, options);
+ v = r_entry0(rb_reg_new_str(str, options), idx, arg);
v = r_leave(v, arg);
}
break;