aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-28 20:36:50 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-28 20:36:50 +0000
commit2d1e5bcefc795115d6eaeceba9bf0b173efd1f57 (patch)
tree1f8c8f0518dbcc330aa0c3c7f44778d3cab352d0
parentaa3b5062707b72189b42a912dc6df58ab3bb68f8 (diff)
downloadruby-2d1e5bcefc795115d6eaeceba9bf0b173efd1f57.tar.gz
marshal.c: fix instance variable load odrder
* marshal.c (r_symreal): fix instance variable load odrder, its name must be read before its value. the order of function call arguments is not stable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--marshal.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/marshal.c b/marshal.c
index 44f56ae411..b14635f034 100644
--- a/marshal.c
+++ b/marshal.c
@@ -1315,7 +1315,8 @@ r_symreal(struct load_arg *arg, int ivar)
if (ivar) {
long num = r_long(arg);
while (num-- > 0) {
- idx = sym2encidx(r_symbol(arg), r_object(arg));
+ sym = r_symbol(arg);
+ idx = sym2encidx(sym, r_object(arg));
}
}
if (idx > 0) rb_enc_associate_index(s, idx);