From: "hsbt (Hiroshi SHIBATA) via ruby-core" Date: 2023-01-22T23:26:27+00:00 Subject: [ruby-core:111976] [Ruby master Bug#19368] Small issue with isolated procs and eval Issue #19368 has been updated by hsbt (Hiroshi SHIBATA). Status changed from Open to Assigned Assignee set to ko1 (Koichi Sasada) ---------------------------------------- Bug #19368: Small issue with isolated procs and eval https://bugs.ruby-lang.org/issues/19368#change-101413 * Author: luke-gru (Luke Gruber) * Status: Assigned * Priority: Normal * Assignee: ko1 (Koichi Sasada) * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- ``` a = Object.new # non-shareable prok = Ractor.current.instance_eval do Proc.new do eval('a') end end prok.call # this should work, we're in the main ractor and the proc is not isolated Ractor.make_shareable(prok) # this doesn't currently work, but I think it should. It gives Ractor::IsolationError. See below for reasoning on why I think it should work. # A flag seems to be set on the proc after it's run and accesses outers... ``` Because this work fine: ```ruby a = Object.new # non-shareable prok = Ractor.current.instance_eval do Proc.new do eval('a') end end Ractor.make_shareable(prok) # this works, and it's okay because we get a different error when actually running the shareable proc inside a ractor that accesses outers through eval. ``` -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/