summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Boussier <[email protected]>2023-11-06 11:10:37 +0100
committerJean Boussier <[email protected]>2023-11-06 12:39:52 +0100
commit4a6bdbd6dc160c4614105f0478d398b2222429e0 ()
treeacb48dd9fa5f6eec673cdde79fcf6fbe0bc49338
parent66769dcd12b1f323e7d38ab1280700a6ffe509d7 (diff)
generic_ivar_set: properly check for TOO_COMPLEX on capacity transition
-rw-r--r--test/ruby/test_shapes.rb32
-rw-r--r--variable.c2
2 files changed, 32 insertions, 2 deletions
@@ -318,7 +318,7 @@ class TestShapes < Test::Unit::TestCase
end;
end
- def test_run_out_of_shape_generic_ivar_set
assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
begin;
class TooComplex < Hash
@@ -345,6 +345,36 @@ class TestShapes < Test::Unit::TestCase
end;
end
def test_run_out_of_shape_instance_variable_defined
assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
begin;
@@ -1516,7 +1516,7 @@ generic_ivar_set(VALUE obj, ID id, VALUE val)
RUBY_ASSERT(index == shape->capacity);
rb_shape_t *next_shape = rb_shape_transition_shape_capa(shape);
- if (shape->type == SHAPE_OBJ_TOO_COMPLEX) {
rb_evict_ivars_to_hash(obj, shape);
rb_complex_ivar_set(obj, id, val);
FL_SET_RAW(obj, FL_EXIVAR);