File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -659,21 +659,24 @@ def construct_old_module
659
659
obj
660
660
end
661
661
662
+ ARRAY_ALLOCATE = Array . method ( :__allocate__ ) . unbind
662
663
ARRAY_APPEND = Array . instance_method ( :<< )
663
664
664
665
def construct_array
665
- obj = [ ]
666
- store_unique_object obj
667
-
668
666
if @user_class
669
667
cls = get_user_class ( )
670
668
if cls < Array
671
- Truffle :: Internal :: Unsafe . set_class obj , cls
669
+ obj = ARRAY_ALLOCATE . bind ( cls ) . call
672
670
else
673
671
# This is what MRI does, it's weird.
674
- return cls . allocate
672
+ obj = cls . allocate
673
+ store_unique_object obj
674
+ return obj
675
675
end
676
+ else
677
+ obj = [ ]
676
678
end
679
+ store_unique_object obj
677
680
678
681
construct_integer . times do |_i |
679
682
ARRAY_APPEND . bind ( obj ) . call ( construct )
You can’t perform that action at this time.
0 commit comments