[#97536] [Ruby master Bug#16694] JIT vs hardened GCC with PCH — v.ondruch@...
Issue #16694 has been reported by vo.x (Vit Ondruch).
11 messages
2020/03/18
[ruby-core:97495] [Ruby master Bug#16642] Splatted empty hash literal produces frozen hash object
From:
naruse@...
Date:
2020-03-14 11:24:48 UTC
List:
ruby-core #97495
Issue #16642 has been updated by naruse (Yui NARUSE).
Backport changed from 2.5: DONTNEED, 2.6: DONTNEED, 2.7: REQUIRED to 2.5: DONTNEED, 2.6: DONTNEED, 2.7: DONE
ruby_2_7 7804720c631d309b2f19457e703ecfb47a59589f.
----------------------------------------
Bug #16642: Splatted empty hash literal produces frozen hash object
https://bugs.ruby-lang.org/issues/16642#change-84643
* Author: Dan0042 (Daniel DeLorme)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 2.7.1p37 (2020-02-20) [x86_64-openbsd6.6]
* Backport: 2.5: DONTNEED, 2.6: DONTNEED, 2.7: DONE
----------------------------------------
When splatting an empty hash literal, internally it's optimized using a global frozen hash object, but this implementation detail can leak into the ruby code outside:
```ruby
ruby2_keywords def foo(*a) a.last end
h = foo(**{})
h[1] = 2
# can't modify frozen Hash: {} (FrozenError)
```
I think this can be considered a bug?
---Files--------------------------------
ruby2_keywords-empty-kw-splat-16642.patch (2.49 KB)
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>