Skip to content

Comments

[pull] master from ruby:master#95

Merged
pull[bot] merged 7 commits intoturkdevops:masterfrom
ruby:master
Jul 16, 2025
Merged

[pull] master from ruby:master#95
pull[bot] merged 7 commits intoturkdevops:masterfrom
ruby:master

Conversation

@pull
Copy link

@pull pull bot commented Jul 16, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.3)

Can you help keep this open source service alive? 💖 Please sponsor : )

nobu and others added 7 commits July 16, 2025 14:09
GitHub Windows-11arm runner now provides `sudo` command, but it is
disabled and seems to need something at "Developer Settings page".
Follow up [Bug #21029].

Currently,  `defined? (x;)` returns `expression` when using Prism parser.

See:
- #12949
- https://bugs.ruby-lang.org/issues/21029

However, `defined? (x;)` returns nil when using parse.y, as reported in bug ticket comment and test-all (when using parse.y parser) test result.

This change adds a context flag to track trailing semicolons in defined? scope.
When a trailing semicolon is detected within a defined? scope, the generated AST node is wrapped with NODE_BLOCK.
This change ensures consistent behavior with `defined? (;x)` .
`ObjectSpace.count_objects` could cause an unintended array allocation.
It returns a hash like `{ :T_ARRAY => 100, :T_STRING => 100, ... }`, so
it creates the key symbol (e.g., `:T_STRING`) for the first time. On
rare occations, this symbol creation internally allocates a new array
for symbol management.

This led to a problematic side effect where calling `count_objects`
twice in a row could produce inconsistent results: the first call would
trigger the hidden array allocation, and the second call would then
report an increased count for `:T_ARRAY`.

This behavior caused test failures in `test/ruby/test_allocation.rb`,
which performs a baseline measurement before an operation and then
asserts the exact number of new allocations.

https://rubyci.s3.amazonaws.com/openbsd-current/ruby-master/log/20250716T053005Z.fail.html.gz

>   1) Failure:
> TestAllocation::ProcCall::WithBlock#test_ruby2_keywords [...]:
> Expected 1 array allocations for "r2k.(1, a: 2, &block)", but 2 arrays allocated.

This change resolves the issue by pre-interning all key symbols used by
`ObjectSpace.count_objects` before its counting. This eliminates the
side effect and ensures the stability of allocation-sensitive tests.

Co-authored-by: Koichi Sasada <ko1@atdot.net>
```
configure.ac:2803: warning: AC_CHECK_FUNCS(\
): you should use literals
../autoconf-2.72/lib/autoconf/functions.m4:117: AC_CHECK_FUNCS is expanded from...
../autoconf-2.72/lib/m4sugar/m4sh.m4:697: AS_IF is expanded from...
```
@pull pull bot locked and limited conversation to collaborators Jul 16, 2025
@pull pull bot added the ⤵️ pull label Jul 16, 2025
@pull pull bot merged commit 830ab2c into turkdevops:master Jul 16, 2025
1 of 2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants