| Age | Commit message (Collapse) | Author |
|
|
|
|
|
Fixes [Bug #21256]
Co-Authored-By: Earlopain <14981592+Earlopain@users.noreply.github.com>
|
|
|
|
|
|
Since cb419e3912f0514b8151469b0a4a4b83cbbcce78 we're no longer testing
this case because foo is redefined on obj1.
|
|
is…"
This reverts commit 265059603c3aa6a13f90096c71b32046a17938f3.
|
|
It was failing to set the leads, like numblocks do, causing the result to be wrapped in an array
|
|
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
Notes:
Merged: https://github.com/ruby/ruby/pull/13360
|
|
The following is crashing for me:
```shell
ruby --yjit --yjit-call-threshold=1 -e '1.tap { raise rescue p it }'
ruby: YJIT has panicked. More info to follow...
thread '<unnamed>' panicked at ./yjit/src/codegen.rs:2402:14:
...
```
It seems `it` sometimes points to the wrong value:
```shell
ruby -e '1.tap { raise rescue p it }'
false
ruby -e '1.tap { begin; raise; ensure; p it; end } rescue nil'
false
```
But only when `$!` is set:
```shell
ruby -e '1.tap { begin; nil; ensure; p it; end }'
1
ruby -e '1.tap { begin; nil; rescue; ensure; p it; end }'
1
ruby -e '1.tap { begin; raise; rescue; ensure; p it; end }'
1
```
Notes:
Merged: https://github.com/ruby/ruby/pull/13360
|
|
Fixes [Bug #21031]
Notes:
Merged: https://github.com/ruby/ruby/pull/12575
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12435
|
|
Revert "[Bug #20965] Define `it` like an ordinary argument (#12398)"
Reverts ruby/ruby#12398 as per https://bugs.ruby-lang.org/issues/20970#note-6 and https://bugs.ruby-lang.org/issues/20965#note-7.
We need more time to design the intended behavior, and it's too late for Ruby 3.4.
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
|
|
Also fixes [Bug #20955]
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
|
|
If there is a syntax error, there could be an ast_node in the result.
This could get leaked if there is a syntax error so parsing could not
complete (parsed is not set to true).
For example, the following script leaks memory:
10.times do
10_000.times do
eval("def foo(...) super(...) {}; end")
rescue SyntaxError
end
puts `ps -o rss= -p #{$$}`
end
Before:
31328
42768
53856
65120
76208
86768
97856
109120
120208
131296
After:
20944
20944
20944
20944
20944
20944
20944
20944
20944
20944
Notes:
Merged: https://github.com/ruby/ruby/pull/11901
|
|
```
-:3: warning: assigned but unused variable - var
-:3: warning: assigned but unused variable - var
-:3: warning: assigned but unused variable - var
-:3: warning: assigned but unused variable - var
-:3: warning: assigned but unused variable - var
-:3: warning: assigned but unused variable - var
```
|
|
https://bugs.ruby-lang.org/issues/20789
Notes:
Merged: https://github.com/ruby/ruby/pull/11850
|
|
Reject argument forwarding in lambda:
- without parentheses
- after optional argument(s)
Notes:
Merged: https://github.com/ruby/ruby/pull/11751
|
|
This caused an issue when `defined?` was in the `if` condition. Its
instructions weren't appended to the instruction sequence even though it was compiled
if a compile-time known logical short-circuit happened before the `defined?`. The catch table
entry (`defined?` compilation produces a catch table entry) was still on the iseq even though the
instructions weren't there. This caused faulty exception handling in the method.
The solution is to no add the catch table entry for `defined?` after a compile-time known logical
short circuit.
This shouldn't touch much code, it's only for cases like the following,
which can occur during debugging:
if false && defined?(Some::CONSTANT)
"more code..."
end
Fixes [Bug #20501]
Notes:
Merged: https://github.com/ruby/ruby/pull/11554
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11716
|
|
|
|
```
/home/chkbuild/chkbuild/tmp/build/20240917T123003Z/ruby/test/ruby/test_case.rb:73: warning: 'when' clause on line 73 duplicates 'when' clause on line 73 and is ignored
/home/chkbuild/chkbuild/tmp/build/20240917T123003Z/ruby/test/ruby/test_syntax.rb:333: warning: key :k1 is duplicated and overwritten on line 333
```
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11611
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11386
|
|
Unparenthesize the argument and make `command_call` when calling with
`do`-block.
Notes:
Merged: https://github.com/ruby/ruby/pull/11216
|
|
call
Notes:
Merged: https://github.com/ruby/ruby/pull/11215
|
|
https://bugs.ruby-lang.org/issues/20478
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
clause duplication
This commit simplifies warnings for hash keys duplication and when clause duplication,
based on the discussion of https://bugs.ruby-lang.org/issues/20331.
Warnings are reported only when strings are same to ohters.
|
|
|
|
|
|
This is designed to replace the newarraykwsplat instruction, which is
no longer used in the parse.y compiler after this commit. This avoids
an unnecessary array allocation in the case where ARGSCAT is followed
by LIST with keyword:
```ruby
a = []
kw = {}
[*a, 1, **kw]
```
Previous Instructions:
```
0000 newarray 0 ( 1)[Li]
0002 setlocal_WC_0 a@0
0004 newhash 0 ( 2)[Li]
0006 setlocal_WC_0 kw@1
0008 getlocal_WC_0 a@0 ( 3)[Li]
0010 splatarray true
0012 putobject_INT2FIX_1_
0013 putspecialobject 1
0015 newhash 0
0017 getlocal_WC_0 kw@1
0019 opt_send_without_block <calldata!mid:core#hash_merge_kwd, argc:2, ARGS_SIMPLE>
0021 newarraykwsplat 2
0023 concattoarray
0024 leave
```
New Instructions:
```
0000 newarray 0 ( 1)[Li]
0002 setlocal_WC_0 a@0
0004 newhash 0 ( 2)[Li]
0006 setlocal_WC_0 kw@1
0008 getlocal_WC_0 a@0 ( 3)[Li]
0010 splatarray true
0012 putobject_INT2FIX_1_
0013 pushtoarray 1
0015 putspecialobject 1
0017 newhash 0
0019 getlocal_WC_0 kw@1
0021 opt_send_without_block <calldata!mid:core#hash_merge_kwd, argc:2, ARGS_SIMPLE>
0023 pushtoarraykwsplat
0024 leave
```
pushtoarraykwsplat is designed to be simpler than newarraykwsplat.
It does not take a variable number of arguments from the stack, it
pops the top of the stack, and appends it to the second from the top,
unless the top of the stack is an empty hash.
During this work, I found the ARGSPUSH followed by HASH with keyword
did not compile correctly, as it pushed the generated hash to the
array even if the hash was empty. This fixes the behavior, to use
pushtoarraykwsplat instead of pushtoarray in that case:
```ruby
a = []
kw = {}
[*a, **kw]
[{}] # Before
[] # After
```
This does not remove the newarraykwsplat instruction, as it is still
referenced in the prism compiler (which should be updated similar
to this), YJIT (only in the bindings, it does not appear to be
implemented), and RJIT (in a couple comments). After those are
updated, the newarraykwsplat instruction should be removed.
|
|
|
|
[Feature #16495]
|
|
For example:
10.times do
100_000.times do
eval('{"\xC3": 1}')
rescue EncodingError
end
puts `ps -o rss= -p #{$$}`
end
Before:
32032
48464
66112
84192
100592
117520
134096
150656
167168
183760
After:
17120
17120
17120
17120
18560
18560
18560
18560
18560
18560
|
|
|
|
|
|
Add test cases for `__LINE__` and `__FILE__` because
they were managed by NODE_LIT and NODE_STR but changed to
be managed by dedicated NODE now.
|
|
`__FILE__` was managed by `NODE_STR` with `String` object.
This commit introduces `NODE_FILE` and `struct rb_parser_string` so that
1. `__FILE__` is detectable from AST Node
2. Reduce dependency ruby object
|
|
Print warning for a code like
```ruby
if __LINE__
end
# => warning: literal in condition
```
|
|
|
|
|
|
[[Feature #18980]](https://bugs.ruby-lang.org/issues/18980)
Co-authored-by: Yusuke Endoh <mame@ruby-lang.org>
|