mirror of
https://github.com/ruby/ruby.git
synced 2025-09-18 01:54:00 +02:00
merge revision(s) ed6fbb79e1
: [Backport #19339]
Fix crash when defining ivars on special constants [Bug #19339] --- test/ruby/test_variable.rb | 6 ++++++ vm_insnhelper.c | 5 +++++ 2 files changed, 11 insertions(+)
This commit is contained in:
parent
373e62248c
commit
c0df0a85de
3 changed files with 12 additions and 1 deletions
|
@ -261,6 +261,12 @@ class TestVariable < Test::Unit::TestCase
|
|||
v.instance_variable_set(:@foo, :bar)
|
||||
end
|
||||
|
||||
assert_raise_with_message(FrozenError, msg, "[Bug #19339]") do
|
||||
v.instance_eval do
|
||||
@a = 1
|
||||
end
|
||||
end
|
||||
|
||||
assert_nil EnvUtil.suppress_warning {v.instance_variable_get(:@foo)}
|
||||
assert_not_send([v, :instance_variable_defined?, :@foo])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue