summaryrefslogtreecommitdiff
path: root/marshal.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-08-10 13:18:41 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-08-10 13:18:41 +0900
commitffdef3674af921d7ddd550dc492dcdbed97f7ba5 (patch)
treec2575b5307453e22085feb2cd586315c585f7266 /marshal.c
parent3c3783ac88f8f8fbbad016a2daf3e35a682c4b3e (diff)
Warn instance variable `E`
It is not dumped, as it is a short alias for `:encoding`.
Diffstat (limited to 'marshal.c')
-rw-r--r--marshal.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/marshal.c b/marshal.c
index 5e0c30b54aa..b6de65023cb 100644
--- a/marshal.c
+++ b/marshal.c
@@ -576,7 +576,13 @@ w_obj_each(st_data_t key, st_data_t val, st_data_t a)
struct w_ivar_arg *ivarg = (struct w_ivar_arg *)a;
struct dump_call_arg *arg = ivarg->dump;
- if (to_be_skipped_id(id)) return ST_CONTINUE;
+ if (to_be_skipped_id(id)) {
+ if (id == s_encoding_short) {
+ rb_warn("instance variable `E' on class %"PRIsVALUE" is not dumped",
+ CLASS_OF(arg->obj));
+ }
+ return ST_CONTINUE;
+ }
if (!ivarg->num_ivar) {
rb_raise(rb_eRuntimeError, "instance variable added to %"PRIsVALUE" instance",
CLASS_OF(arg->obj));