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

ruby-changes:70071

From: Alan <ko1@a...>
Date: Mon, 6 Dec 2021 01:15:22 +0900 (JST)
Subject: [ruby-changes:70071] a785e6c356 (master): Make `leaf` const in VM generator

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

From a785e6c356850ce097c8403df4c59c6a77df9bcc Mon Sep 17 00:00:00 2001
From: Alan Wu <alanwu@r...>
Date: Sun, 5 Dec 2021 11:02:55 -0500
Subject: Make `leaf` const in VM generator

Assigning to `leaf` in insns.def would give undesirable results.
---
 tool/ruby_vm/views/_insn_entry.erb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tool/ruby_vm/views/_insn_entry.erb b/tool/ruby_vm/views/_insn_entry.erb
index bdd0fa3c7cb..f34afddb1f3 100644
--- a/tool/ruby_vm/views/_insn_entry.erb
+++ b/tool/ruby_vm/views/_insn_entry.erb
@@ -24,7 +24,7 @@ INSN_ENTRY(<%= insn.name %>) https://github.com/ruby/ruby/blob/trunk/tool/ruby_vm/views/_insn_entry.erb#L24
     <%= ope[:decl] %> = (<%= ope[:type] %>)GET_OPERAND(<%= i + 1 %>);
 % end
 #   define INSN_ATTR(x) <%= insn.call_attribute(' ## x ## ') %>
-    bool leaf = INSN_ATTR(leaf);
+    const bool leaf = INSN_ATTR(leaf);
 % insn.pops.reverse_each.with_index.reverse_each do |pop, i|
     <%= pop[:decl] %> = <%= insn.cast_from_VALUE pop, "TOPN(#{i})"%>;
 % end
-- 
cgit v1.2.1


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

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