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

ruby-changes:48931

From: mame <ko1@a...>
Date: Wed, 6 Dec 2017 16:26:58 +0900 (JST)
Subject: [ruby-changes:48931] mame:r61050 (trunk): compile.c (rb_iseq_compile_node): Move the check for imemo_ifunc to top

mame	2017-12-06 16:26:54 +0900 (Wed, 06 Dec 2017)

  New Revision: 61050

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

  Log:
    compile.c (rb_iseq_compile_node): Move the check for imemo_ifunc to top
    
    Applying nd_type to imemo_ifunc object seems harmless fortunately, but
    very dirty (to me).

  Modified files:
    trunk/compile.c
Index: compile.c
===================================================================
--- compile.c	(revision 61049)
+++ compile.c	(revision 61050)
@@ -618,6 +618,12 @@ rb_iseq_compile_node(rb_iseq_t *iseq, co https://github.com/ruby/ruby/blob/trunk/compile.c#L618
 	COMPILE(ret, "nil", node);
 	iseq_set_local_table(iseq, 0);
     }
+    else if (imemo_type_p((VALUE)node, imemo_ifunc)) {
+	const struct vm_ifunc *ifunc = (struct vm_ifunc *)node;
+	/* user callback */
+	(*ifunc->func)(iseq, ret, ifunc->data);
+    }
+    /* assume node is T_NODE */
     else if (nd_type(node) == NODE_SCOPE) {
 	/* iseq type of top, method, class, block */
 	iseq_set_local_table(iseq, node->nd_tbl);
@@ -664,11 +670,6 @@ rb_iseq_compile_node(rb_iseq_t *iseq, co https://github.com/ruby/ruby/blob/trunk/compile.c#L670
 	  }
 	}
     }
-    else if (imemo_type_p((VALUE)node, imemo_ifunc)) {
-	const struct vm_ifunc *ifunc = (struct vm_ifunc *)node;
-	/* user callback */
-	(*ifunc->func)(iseq, ret, ifunc->data);
-    }
     else {
 	const char *m;
 #define INVALID_ISEQ_TYPE(type) \

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

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