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

ruby-changes:62587

From: wanabe <ko1@a...>
Date: Sun, 16 Aug 2020 18:39:39 +0900 (JST)
Subject: [ruby-changes:62587] 691f10dd89 (master): Adjust sp for `case ... in *, a, * end`

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

From 691f10dd89e8a3feedab5bea823038469b3d6d66 Mon Sep 17 00:00:00 2001
From: wanabe <s.wanabe@g...>
Date: Sun, 9 Aug 2020 17:49:11 +0900
Subject: Adjust sp for `case ... in *, a, * end`


diff --git a/compile.c b/compile.c
index def5a4a..9780f6e 100644
--- a/compile.c
+++ b/compile.c
@@ -5929,6 +5929,7 @@ iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *c https://github.com/ruby/ruby/blob/trunk/compile.c#L5929
             ADD_INSN(ret, line, pop);
             ADD_INSN(ret, line, pop);
             ADD_INSNL(ret, line, jump, match_failed);
+            ADD_INSN1(ret, line, dupn, INT2FIX(3));
 
             ADD_LABEL(ret, find_succeeded);
             ADD_INSN(ret, line, pop);
@@ -5938,12 +5939,14 @@ iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *c https://github.com/ruby/ruby/blob/trunk/compile.c#L5939
 
         ADD_INSN(ret, line, pop);
         ADD_INSNL(ret, line, jump, matched);
+        ADD_INSN(ret, line, putnil);
 
         ADD_LABEL(ret, type_error);
         ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
         ADD_INSN1(ret, line, putobject, rb_eTypeError);
         ADD_INSN1(ret, line, putobject, rb_fstring_lit("deconstruct must return Array"));
         ADD_SEND(ret, line, id_core_raise, INT2FIX(2));
+        ADD_INSN(ret, line, pop);
 
         ADD_LABEL(ret, match_failed);
         ADD_INSN(ret, line, pop);
-- 
cgit v0.10.2


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

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