summaryrefslogtreecommitdiff
path: root/marshal.c
diff options
context:
space:
mode:
authorS-H-GAMELINKS <gamelinks007@gmail.com>2022-11-15 13:24:08 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-11-16 18:58:33 +0900
commit1f4f6c9832d83e7ebd65ccf4e95cef358b3512c6 (patch)
tree823f1ca5409fdd930b05d974cdb70953b6e7e128 /marshal.c
parentdc1c4e46758ace2c9e5e822df0d64b16bb564bb4 (diff)
downloadruby-1f4f6c9832d83e7ebd65ccf4e95cef358b3512c6.tar.gz
Using UNDEF_P macro
Diffstat (limited to 'marshal.c')
-rw-r--r--marshal.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/marshal.c b/marshal.c
index d956260d96..e1612303fe 100644
--- a/marshal.c
+++ b/marshal.c
@@ -743,7 +743,7 @@ w_ivar(st_index_t num, VALUE ivobj, VALUE encname, struct dump_call_arg *arg)
w_object(Qtrue, arg->arg, limit);
num--;
}
- if (ivobj != Qundef && num) {
+ if (!UNDEF_P(ivobj) && num) {
w_ivar_each(ivobj, num, arg);
}
}
@@ -930,7 +930,7 @@ w_object(VALUE obj, struct dump_arg *arg, int limit)
arg->compat_tbl = rb_init_identtable();
}
st_insert(arg->compat_tbl, (st_data_t)obj, (st_data_t)real_obj);
- if (obj != real_obj && ivobj == Qundef) hasiv = 0;
+ if (obj != real_obj && UNDEF_P(ivobj)) hasiv = 0;
}
}
if (hasiv) w_byte(TYPE_IVAR, arg);
@@ -2251,7 +2251,7 @@ r_object_for(struct load_arg *arg, bool partial, int *ivp, VALUE extmod, int typ
break;
}
- if (v == Qundef) {
+ if (UNDEF_P(v)) {
rb_raise(rb_eArgError, "dump format error (bad link)");
}