From be782b7d36c308af33580478ddea477903caf571 Mon Sep 17 00:00:00 2001 From: dearblue Date: Tue, 19 Apr 2022 21:48:50 +0900 Subject: [PATCH] Setting `Command#build` correctly in automatic "mrbc" build for presym This was the cause of the command line flag being affected by changes in the parent build. So, for example, if `mruby-rational` was included, even the automatically added `mrbc` builds included `MRB_USE_RATIONAL`. --- lib/mruby/build.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/mruby/build.rb b/lib/mruby/build.rb index 771aa7f3e..4925cee33 100644 --- a/lib/mruby/build.rb +++ b/lib/mruby/build.rb @@ -500,7 +500,8 @@ EOS v = instance_variable_get(n) v = case v when nil, true, false, Numeric; v - when String, Command; v.clone + when String; v.clone + when Command; v.clone.tap { |u| u.build = build } else Marshal.load(Marshal.dump(v)) # deep clone end build.instance_variable_set(n, v)