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:
NARUSE, Yui 2023-01-20 17:01:47 +09:00
parent 373e62248c
commit c0df0a85de
3 changed files with 12 additions and 1 deletions

View file

@ -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])