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

ruby-changes:62586

From: wanabe <ko1@a...>
Date: Sun, 16 Aug 2020 18:39:39 +0900 (JST)
Subject: [ruby-changes:62586] 0759862458 (master): Adjust sp for pattern matching implicit/explicit "else"

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

From 0759862458c25bb8a7832090545c625c364e5d94 Mon Sep 17 00:00:00 2001
From: wanabe <s.wanabe@g...>
Date: Sat, 8 Aug 2020 16:08:47 +0900
Subject: Adjust sp for pattern matching implicit/explicit "else"


diff --git a/compile.c b/compile.c
index c7a4a8c..fa3c513 100644
--- a/compile.c
+++ b/compile.c
@@ -6385,6 +6385,10 @@ compile_case3(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const orig_no https://github.com/ruby/ruby/blob/trunk/compile.c#L6385
         add_trace_branch_coverage(iseq, cond_seq, node, branch_id, "else", branches);
         CHECK(COMPILE_(cond_seq, "else", node, popped));
         ADD_INSNL(cond_seq, line, jump, endlabel);
+        ADD_INSN(cond_seq, line, putnil);
+        if (popped) {
+                ADD_INSN(cond_seq, line, putnil);
+        }
     }
     else {
         debugs("== else (implicit)\n");
@@ -6401,6 +6405,10 @@ compile_case3(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const orig_no https://github.com/ruby/ruby/blob/trunk/compile.c#L6405
             ADD_INSN(cond_seq, nd_line(orig_node), putnil);
         }
         ADD_INSNL(cond_seq, nd_line(orig_node), jump, endlabel);
+        ADD_INSN(cond_seq, line, putnil);
+        if (popped) {
+                ADD_INSN(cond_seq, line, putnil);
+        }
     }
 
     ADD_SEQ(ret, cond_seq);
-- 
cgit v0.10.2


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

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