[前][次][番号順一覧][スレッド一覧]

ruby-changes:49828

From: shyouhei <ko1@a...>
Date: Fri, 19 Jan 2018 14:18:25 +0900 (JST)
Subject: [ruby-changes:49828] shyouhei:r61946 (trunk): there is no such thing like 0 in enum defined_type

shyouhei	2018-01-19 14:18:18 +0900 (Fri, 19 Jan 2018)

  New Revision: 61946

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61946

  Log:
    there is no such thing like 0 in enum defined_type
    
    introduce new enum for it.

  Modified files:
    trunk/compile.c
    trunk/iseq.h
    trunk/vm_insnhelper.c
Index: iseq.h
===================================================================
--- iseq.h	(revision 61945)
+++ iseq.h	(revision 61946)
@@ -276,6 +276,7 @@ struct iseq_compile_data_storage { https://github.com/ruby/ruby/blob/trunk/iseq.h#L276
 /* defined? */
 
 enum defined_type {
+    DEFINED_NOT_DEFINED,
     DEFINED_NIL = 1,
     DEFINED_IVAR,
     DEFINED_LVAR,
Index: compile.c
===================================================================
--- compile.c	(revision 61945)
+++ compile.c	(revision 61946)
@@ -4113,7 +4113,7 @@ static int https://github.com/ruby/ruby/blob/trunk/compile.c#L4113
 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)) {
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 61945)
+++ vm_insnhelper.c	(revision 61946)
@@ -2809,7 +2809,7 @@ check_respond_to_missing(VALUE obj, VALU https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L2809
 	return DEFINED_METHOD;
     }
     else {
-	return 0;
+	return DEFINED_NOT_DEFINED;
     }
 }
 
@@ -2817,7 +2817,7 @@ static VALUE https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L2817
 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) {

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]