[#116016] [Ruby master Bug#20150] Memory leak in grapheme clusters — "peterzhu2118 (Peter Zhu) via ruby-core" <ruby-core@...>
Issue #20150 has been reported by peterzhu2118 (Peter Zhu).
7 messages
2024/01/04
[#116382] [Ruby master Feature#20205] Enable `frozen_string_literal` by default — "byroot (Jean Boussier) via ruby-core" <ruby-core@...>
Issue #20205 has been reported by byroot (Jean Boussier).
77 messages
2024/01/23
[ruby-core:116455] [Ruby master Bug#20213] zsuper with keyword splat without explicit keywords incorrectly uses mutable keyword splat
From:
"jeremyevans0 (Jeremy Evans) via ruby-core" <ruby-core@...>
Date:
2024-01-26 04:54:42 UTC
List:
ruby-core #116455
Issue #20213 has been updated by jeremyevans0 (Jeremy Evans).
Status changed from Open to Closed
Fixed by commit:771a2f039b9a059a73e8f111d1d46590fa697f63
----------------------------------------
Bug #20213: zsuper with keyword splat without explicit keywords incorrectly uses mutable keyword splat
https://bugs.ruby-lang.org/issues/20213#change-106478
* Author: jeremyevans0 (Jeremy Evans)
* Status: Closed
* Priority: Normal
* Backport: 3.0: DONTNEED, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: REQUIRED
----------------------------------------
As the subject states, the super call in this code is compiled incorrectly:
```ruby
extend(Module.new{def a(**k) k[:a] = 1 end})
extend(Module.new{def a(**k) p k; super; p k end})
a
# Expected output, actual output on Ruby 2.0-3.2:
{}
{}
# Actual output on Ruby 3.3 and master
{}
{:a=>1}
```
The zsuper call here uses VM_CALL_KW_SPLAT_MUT:
```
invokesuper <calldata!argc:1, FCALL|SUPER|ZSUPER|KW_SPLAT|KW_SPLAT_MUT>, nil
```
That is not correct, because as the example shows, if the super method accepts a keyword splat, the super method can modify the keyword splat, and changes are reflected in the caller.
I submitted a pull request to fix this: https://github.com/ruby/ruby/pull/9710, and marked this for backporting to 3.3.
--
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/