From a7a81aa7614402fe05564048ac2d97f734d9d3fd Mon Sep 17 00:00:00 2001 From: dearblue Date: Sun, 27 Oct 2024 10:41:51 +0900 Subject: [PATCH] Storing method-id inside Symbol#to_proc When called in combination with a method like `*_eval` or `*_exec` that switches self, `__send__` was passed an object that was not necessarily a symbol as the method name. This problem was discovered during the #6389 correction process. --- mrblib/symbol.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mrblib/symbol.rb b/mrblib/symbol.rb index 827e2c1e0..17d752906 100644 --- a/mrblib/symbol.rb +++ b/mrblib/symbol.rb @@ -1,7 +1,8 @@ class Symbol def to_proc + mid = self ->(obj,*args,**opts,&block) do - obj.__send__(self, *args, **opts, &block) + obj.__send__(mid, *args, **opts, &block) end end end