parent
f8249eb49a
commit
ed6fbb79e1
Notes:
git
2023-01-17 09:51:45 +00:00
@ -261,6 +261,12 @@ class TestVariable < Test::Unit::TestCase
|
|||||||
v.instance_variable_set(:@foo, :bar)
|
v.instance_variable_set(:@foo, :bar)
|
||||||
end
|
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_nil EnvUtil.suppress_warning {v.instance_variable_get(:@foo)}
|
||||||
assert_not_send([v, :instance_variable_defined?, :@foo])
|
assert_not_send([v, :instance_variable_defined?, :@foo])
|
||||||
|
|
||||||
|
@ -1562,6 +1562,11 @@ vm_getinstancevariable(const rb_iseq_t *iseq, VALUE obj, ID id, IVC ic)
|
|||||||
static inline void
|
static inline void
|
||||||
vm_setinstancevariable(const rb_iseq_t *iseq, VALUE obj, ID id, VALUE val, IVC ic)
|
vm_setinstancevariable(const rb_iseq_t *iseq, VALUE obj, ID id, VALUE val, IVC ic)
|
||||||
{
|
{
|
||||||
|
if (RB_SPECIAL_CONST_P(obj)) {
|
||||||
|
rb_error_frozen_object(obj);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
shape_id_t dest_shape_id;
|
shape_id_t dest_shape_id;
|
||||||
attr_index_t index;
|
attr_index_t index;
|
||||||
vm_ic_atomic_shape_and_index(ic, &dest_shape_id, &index);
|
vm_ic_atomic_shape_and_index(ic, &dest_shape_id, &index);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user