* [ruby-core:116516] [Ruby master Bug#20229] Empty keyword splat in array not removed in ARGSPUSH case
@ 2024-01-30 20:00 jeremyevans0 (Jeremy Evans) via ruby-core
2024-01-30 20:29 ` [ruby-core:116517] " jeremyevans0 (Jeremy Evans) via ruby-core
2024-02-20 18:49 ` [ruby-core:116885] " jeremyevans0 (Jeremy Evans) via ruby-core
0 siblings, 2 replies; 3+ messages in thread
From: jeremyevans0 (Jeremy Evans) via ruby-core @ 2024-01-30 20:00 UTC (permalink / raw
To: ruby-core; +Cc: jeremyevans0 (Jeremy Evans)
Issue #20229 has been reported by jeremyevans0 (Jeremy Evans).
----------------------------------------
Bug #20229: Empty keyword splat in array not removed in ARGSPUSH case
https://bugs.ruby-lang.org/issues/20229
* Author: jeremyevans0 (Jeremy Evans)
* Status: Open
* Priority: Normal
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
For the following code:
```ruby
a = []
kw = {}
[*a, **kw]
```
Ruby 2.0-3.3 return `[{}]`, when the desired result (since 2.7) is `[]`.
I discovered this while working on an optimization for the ARGSCAT case, where `[*a, 1, **kw]` allocates two arrays instead of a single array. My optimization fixes that by adding a `pushtoarraykwsplat` instruction as a replacement for `newarraykwsplat`. I've used `pushtoarraykwsplat` in the ARGSPUSH case to fix this bug.
My pull request for the bug fix and optimization: https://github.com/ruby/ruby/pull/9766
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* [ruby-core:116517] [Ruby master Bug#20229] Empty keyword splat in array not removed in ARGSPUSH case
2024-01-30 20:00 [ruby-core:116516] [Ruby master Bug#20229] Empty keyword splat in array not removed in ARGSPUSH case jeremyevans0 (Jeremy Evans) via ruby-core
@ 2024-01-30 20:29 ` jeremyevans0 (Jeremy Evans) via ruby-core
2024-02-20 18:49 ` [ruby-core:116885] " jeremyevans0 (Jeremy Evans) via ruby-core
1 sibling, 0 replies; 3+ messages in thread
From: jeremyevans0 (Jeremy Evans) via ruby-core @ 2024-01-30 20:29 UTC (permalink / raw
To: ruby-core; +Cc: jeremyevans0 (Jeremy Evans)
Issue #20229 has been updated by jeremyevans0 (Jeremy Evans).
I found that this bug was actually reported earlier in #20180, which I already have submitted a pull request to fix. I think we should use the approach in this pull request to fix this issue in master, as it is more efficient. We could backport the fix in #20180 to Ruby 3.1-3.3.
----------------------------------------
Bug #20229: Empty keyword splat in array not removed in ARGSPUSH case
https://bugs.ruby-lang.org/issues/20229#change-106536
* Author: jeremyevans0 (Jeremy Evans)
* Status: Open
* Priority: Normal
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
For the following code:
```ruby
a = []
kw = {}
[*a, **kw]
```
Ruby 2.0-3.3 return `[{}]`, when the desired result (since 2.7) is `[]`.
I discovered this while working on an optimization for the ARGSCAT case, where `[*a, 1, **kw]` allocates two arrays instead of a single array. My optimization fixes that by adding a `pushtoarraykwsplat` instruction as a replacement for `newarraykwsplat`. I've used `pushtoarraykwsplat` in the ARGSPUSH case to fix this bug.
My pull request for the bug fix and optimization: https://github.com/ruby/ruby/pull/9766
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* [ruby-core:116885] [Ruby master Bug#20229] Empty keyword splat in array not removed in ARGSPUSH case
2024-01-30 20:00 [ruby-core:116516] [Ruby master Bug#20229] Empty keyword splat in array not removed in ARGSPUSH case jeremyevans0 (Jeremy Evans) via ruby-core
2024-01-30 20:29 ` [ruby-core:116517] " jeremyevans0 (Jeremy Evans) via ruby-core
@ 2024-02-20 18:49 ` jeremyevans0 (Jeremy Evans) via ruby-core
1 sibling, 0 replies; 3+ messages in thread
From: jeremyevans0 (Jeremy Evans) via ruby-core @ 2024-02-20 18:49 UTC (permalink / raw
To: ruby-core; +Cc: jeremyevans0 (Jeremy Evans)
Issue #20229 has been updated by jeremyevans0 (Jeremy Evans).
Status changed from Open to Closed
Committed as commit:77c1233f79a0f96a081b70da533fbbde4f3037fa
----------------------------------------
Bug #20229: Empty keyword splat in array not removed in ARGSPUSH case
https://bugs.ruby-lang.org/issues/20229#change-106921
* Author: jeremyevans0 (Jeremy Evans)
* Status: Closed
* Priority: Normal
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
For the following code:
```ruby
a = []
kw = {}
[*a, **kw]
```
Ruby 2.0-3.3 return `[{}]`, when the desired result (since 2.7) is `[]`.
I discovered this while working on an optimization for the ARGSCAT case, where `[*a, 1, **kw]` allocates two arrays instead of a single array. My optimization fixes that by adding a `pushtoarraykwsplat` instruction as a replacement for `newarraykwsplat`. I've used `pushtoarraykwsplat` in the ARGSPUSH case to fix this bug.
My pull request for the bug fix and optimization: https://github.com/ruby/ruby/pull/9766
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-02-20 18:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-30 20:00 [ruby-core:116516] [Ruby master Bug#20229] Empty keyword splat in array not removed in ARGSPUSH case jeremyevans0 (Jeremy Evans) via ruby-core
2024-01-30 20:29 ` [ruby-core:116517] " jeremyevans0 (Jeremy Evans) via ruby-core
2024-02-20 18:49 ` [ruby-core:116885] " jeremyevans0 (Jeremy Evans) via ruby-core
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).