summaryrefslogtreecommitdiff
path: root/marshal.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-29 03:28:43 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-29 03:28:43 (GMT)
commit360a8652464c4fd44808d488a0f178272b98208a (patch)
treed26cd33fbce9b2427c4083e5b4b9740b329fa030 /marshal.c
parentfbc3f55ba7f67ed2198f04d9c4ed221cf18e4162 (diff)
marshal.c: fix symlink index
* marshal.c (w_symbol): fix symlink index. register the given symbols, not its name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'marshal.c')
-rw-r--r--marshal.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/marshal.c b/marshal.c
index b14635f..598f90f 100644
--- a/marshal.c
+++ b/marshal.c
@@ -422,6 +422,7 @@ w_symbol(VALUE sym, struct dump_arg *arg)
w_long((long)num, arg);
}
else {
+ const VALUE orig_sym = sym;
sym = rb_sym2str(sym);
if (!sym) {
rb_raise(rb_eTypeError, "can't dump anonymous ID %"PRIdVALUE, sym);
@@ -436,7 +437,7 @@ w_symbol(VALUE sym, struct dump_arg *arg)
}
w_byte(TYPE_SYMBOL, arg);
w_bytes(RSTRING_PTR(sym), RSTRING_LEN(sym), arg);
- st_add_direct(arg->symbols, sym, arg->symbols->num_entries);
+ st_add_direct(arg->symbols, orig_sym, arg->symbols->num_entries);
if (!NIL_P(encname)) {
struct dump_call_arg c_arg;
c_arg.limit = 1;