ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:93322] [Ruby trunk Bug#15952] Issue with Array#unshift, sometimes doesn't respect frozenness of array
       [not found] <redmine.issue-15952.20190622222318@ruby-lang.org>
@ 2019-06-22 22:23 ` luke.gru
  2019-06-22 22:39 ` [ruby-core:93323] " luke.gru
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: luke.gru @ 2019-06-22 22:23 UTC (permalink / raw
  To: ruby-core

Issue #15952 has been reported by luke-gru (Luke Gruber).

----------------------------------------
Bug #15952: Issue with Array#unshift, sometimes doesn't respect frozenness of array
https://bugs.ruby-lang.org/issues/15952

* Author: luke-gru (Luke Gruber)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
This should raise a `FrozenError`, but doesn't:

```ruby
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,



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:93323] [Ruby trunk Bug#15952] Issue with Array#unshift, sometimes doesn't respect frozenness of array
       [not found] <redmine.issue-15952.20190622222318@ruby-lang.org>
  2019-06-22 22:23 ` [ruby-core:93322] [Ruby trunk Bug#15952] Issue with Array#unshift, sometimes doesn't respect frozenness of array luke.gru
@ 2019-06-22 22:39 ` luke.gru
  2019-08-09 14:28 ` [ruby-core:94222] [Ruby master " nagachika00
  2019-08-26 16:20 ` [ruby-core:94580] " usa
  3 siblings, 0 replies; 4+ messages in thread
From: luke.gru @ 2019-06-22 22:39 UTC (permalink / raw
  To: ruby-core

Issue #15952 has been updated by luke-gru (Luke Gruber).


PR here: https://github.com/ruby/ruby/pull/2251

----------------------------------------
Bug #15952: Issue with Array#unshift, sometimes doesn't respect frozenness of array
https://bugs.ruby-lang.org/issues/15952#change-78800

* Author: luke-gru (Luke Gruber)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
This should raise a `FrozenError`, but doesn't:

```ruby
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,



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:94222] [Ruby master Bug#15952] Issue with Array#unshift, sometimes doesn't respect frozenness of array
       [not found] <redmine.issue-15952.20190622222318@ruby-lang.org>
  2019-06-22 22:23 ` [ruby-core:93322] [Ruby trunk Bug#15952] Issue with Array#unshift, sometimes doesn't respect frozenness of array luke.gru
  2019-06-22 22:39 ` [ruby-core:93323] " luke.gru
@ 2019-08-09 14:28 ` nagachika00
  2019-08-26 16:20 ` [ruby-core:94580] " usa
  3 siblings, 0 replies; 4+ messages in thread
From: nagachika00 @ 2019-08-09 14:28 UTC (permalink / raw
  To: ruby-core

Issue #15952 has been updated by nagachika (Tomoyuki Chikanaga).

Backport changed from 2.4: UNKNOWN, 2.5: REQUIRED, 2.6: REQUIRED to 2.4: UNKNOWN, 2.5: REQUIRED, 2.6: DONE

ruby_2_6 r67740 merged revision(s) ec8e5f5aa64e2a54cf1e303f2b012c98e8d521ba,5a187e26adc8aa32367f294c1496935c7356d386.

----------------------------------------
Bug #15952: Issue with Array#unshift, sometimes doesn't respect frozenness of array
https://bugs.ruby-lang.org/issues/15952#change-80521

* Author: luke-gru (Luke Gruber)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.4: UNKNOWN, 2.5: REQUIRED, 2.6: DONE
----------------------------------------
This should raise a `FrozenError`, but doesn't:

```ruby
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,



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:94580] [Ruby master Bug#15952] Issue with Array#unshift, sometimes doesn't respect frozenness of array
       [not found] <redmine.issue-15952.20190622222318@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2019-08-09 14:28 ` [ruby-core:94222] [Ruby master " nagachika00
@ 2019-08-26 16:20 ` usa
  3 siblings, 0 replies; 4+ messages in thread
From: usa @ 2019-08-26 16:20 UTC (permalink / raw
  To: ruby-core

Issue #15952 has been updated by usa (Usaku NAKAMURA).

Backport changed from 2.4: UNKNOWN, 2.5: REQUIRED, 2.6: DONE to 2.4: UNKNOWN, 2.5: DONE, 2.6: DONE

ruby_2_5 r67771 merged revision(s) ec8e5f5aa64e2a54cf1e303f2b012c98e8d521ba,5a187e26adc8aa32367f294c1496935c7356d386.

----------------------------------------
Bug #15952: Issue with Array#unshift, sometimes doesn't respect frozenness of array
https://bugs.ruby-lang.org/issues/15952#change-81038

* Author: luke-gru (Luke Gruber)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.4: UNKNOWN, 2.5: DONE, 2.6: DONE
----------------------------------------
This should raise a `FrozenError`, but doesn't:

```ruby
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,



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-08-26 16:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <redmine.issue-15952.20190622222318@ruby-lang.org>
2019-06-22 22:23 ` [ruby-core:93322] [Ruby trunk Bug#15952] Issue with Array#unshift, sometimes doesn't respect frozenness of array luke.gru
2019-06-22 22:39 ` [ruby-core:93323] " luke.gru
2019-08-09 14:28 ` [ruby-core:94222] [Ruby master " nagachika00
2019-08-26 16:20 ` [ruby-core:94580] " usa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).