summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compile.c2
-rw-r--r--iseq.h1
-rw-r--r--vm_insnhelper.c4
3 files changed, 4 insertions, 3 deletions
diff --git a/compile.c b/compile.c
index c3afd6c121..04a32556f2 100644
--- a/compile.c
+++ b/compile.c
@@ -4113,7 +4113,7 @@ static int
defined_expr0(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
const NODE *const node, LABEL **lfinish, VALUE needstr)
{
- enum defined_type expr_type = 0;
+ enum defined_type expr_type = DEFINED_NOT_DEFINED;
enum node_type type;
switch (type = nd_type(node)) {
diff --git a/iseq.h b/iseq.h
index 283f5dcdf4..0c316e2cb2 100644
--- a/iseq.h
+++ b/iseq.h
@@ -276,6 +276,7 @@ struct iseq_compile_data_storage {
/* defined? */
enum defined_type {
+ DEFINED_NOT_DEFINED,
DEFINED_NIL = 1,
DEFINED_IVAR,
DEFINED_LVAR,
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 1327050b2d..8b9bdeb98e 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -2809,7 +2809,7 @@ check_respond_to_missing(VALUE obj, VALUE v)
return DEFINED_METHOD;
}
else {
- return 0;
+ return DEFINED_NOT_DEFINED;
}
}
@@ -2817,7 +2817,7 @@ static VALUE
vm_defined(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp, rb_num_t op_type, VALUE obj, VALUE needstr, VALUE v)
{
VALUE klass;
- enum defined_type expr_type = 0;
+ enum defined_type expr_type = DEFINED_NOT_DEFINED;
enum defined_type type = (enum defined_type)op_type;
switch (type) {