Actions
Bug #15952
closedIssue with Array#unshift, sometimes doesn't respect frozenness of array
Bug #15952:
Issue with Array#unshift, sometimes doesn't respect frozenness of array
Description
This should raise a FrozenError
, but doesn't:
a = [1] * 100
b = a[4..-1]
a.replace([1])
b.freeze
b.unshift("a") # no error
There is a code path in ary_ensure_room_for_unshift
where the frozen check is skipped. I'll hoist this check to the top of the function in a PR.
Thanks,
Actions