summaryrefslogtreecommitdiff
path: root/marshal.c
diff options
context:
space:
mode:
Diffstat (limited to 'marshal.c')
-rw-r--r--marshal.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/marshal.c b/marshal.c
index 5db23fcbc6..3b9f93e545 100644
--- a/marshal.c
+++ b/marshal.c
@@ -1161,8 +1161,7 @@ r_symreal(struct load_arg *arg, int ivar)
idx = id2encidx(id, r_object(arg));
}
}
- if (idx < 0) idx = rb_usascii_encindex();
- rb_enc_associate_index(s, idx);
+ if (idx > 0) rb_enc_associate_index(s, idx);
id = rb_intern_str(s);
st_insert(arg->symbols, (st_data_t)n, (st_data_t)id);