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

ruby-changes:71309

From: S.H <ko1@a...>
Date: Wed, 2 Mar 2022 09:27:48 +0900 (JST)
Subject: [ruby-changes:71309] f7491e89b9 (master): Using macros to check iseq element

https://git.ruby-lang.org/ruby.git/commit/?id=f7491e89b9

From f7491e89b9daacbdbfb716d585e9c325ab6d3f45 Mon Sep 17 00:00:00 2001
From: "S.H" <gamelinks007@g...>
Date: Wed, 2 Mar 2022 09:27:30 +0900
Subject: Using macros to check iseq element

---
 compile.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/compile.c b/compile.c
index 9c96ce7f8e..cd3f0e2a9d 100644
--- a/compile.c
+++ b/compile.c
@@ -2093,7 +2093,7 @@ fix_sp_depth(rb_iseq_t *iseq, LINK_ANCHOR *const anchor) https://github.com/ruby/ruby/blob/trunk/compile.c#L2093
     LINK_ELEMENT *list;
 
     for (list = FIRST_ELEMENT(anchor); list; list = list->next) {
-	if (list->type == ISEQ_ELEMENT_LABEL) {
+	if (IS_LABEL(list)) {
 	    LABEL *lobj = (LABEL *)list;
 	    lobj->set = TRUE;
 	}
@@ -5629,7 +5629,7 @@ setup_args(rb_iseq_t *iseq, LINK_ANCHOR *const args, const NODE *argn, https://github.com/ruby/ruby/blob/trunk/compile.c#L5629
 
         if (LIST_INSN_SIZE_ONE(arg_block)) {
             LINK_ELEMENT *elem = FIRST_ELEMENT(arg_block);
-            if (elem->type == ISEQ_ELEMENT_INSN) {
+            if (IS_INSN(elem)) {
                 INSN *iobj = (INSN *)elem;
                 if (iobj->insn_id == BIN(getblockparam)) {
                     iobj->insn_id = BIN(getblockparamproxy);
@@ -7867,7 +7867,7 @@ delegate_call_p(const rb_iseq_t *iseq, unsigned int argc, const LINK_ANCHOR *arg https://github.com/ruby/ruby/blob/trunk/compile.c#L7867
             const LINK_ELEMENT *elem = FIRST_ELEMENT(args);
 
             for (unsigned int i=start; i-start<argc; i++) {
-                if (elem->type == ISEQ_ELEMENT_INSN &&
+                if (IS_INSN(elem) &&
                     INSN_OF(elem) == BIN(getlocal)) {
                     int local_index = FIX2INT(OPERAND_AT(elem, 0));
                     int local_level = FIX2INT(OPERAND_AT(elem, 1));
-- 
cgit v1.2.1


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

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