| Age | Commit message (Collapse) | Author |
|
Fixes ruby/prism#2295.
|
|
Sometimes this file get picked up and break Ripper tests:
TestRipper::Generic#test_parse_files:test/ruby
assert_separately failed with error message
pid 63392 exit 0
| test_regexp.rb:2025: warning: character class has duplicated range
https://github.com/ruby/ruby/actions/runs/7699956651/job/20982702553#step:12:103
|
|
|
|
Fixes ruby/prism#2290.
|
|
|
|
|
|
Fixes ruby/prism#2242.
|
|
Suppose YJIT runs a rb_vm_opt_send_without_block()
fallback and the control frame stack looks like:
```
will_tailcall_bar [FINISH]
caller_that_used_fallback
```
will_tailcall_bar() runs in the interpreter and sets up a tailcall.
Right before JIT_EXEC() in the `send` instruction, the stack will look like:
```
bar [FINISH]
caller_that_used_fallback
```
Previously, JIT_EXEC() ran bar() in JIT code, which caused the `FINISH`
flag to return to the interpreter instead of to the JIT code running
caller_that_used_fallback(), causing code to run twice and probably
crash. Recent flaky failures on CI about "each stub expects a particular
iseq" are probably due to leaving methods twice in
`test_optimizations.rb`.
Only run JIT code from the interpreter if a new frame is pushed.
|
|
Fixes ruby/prism#2272.
|
|
Fix [Bug #20207]
Fix [Bug #20212]
Handling consecutive lookarounds in init_cache_opcodes is buggy, so it
causes invalid memory access reported in [Bug #20207] and [Bug #20212].
This fixes it by using recursive functions to detected lookarounds
nesting correctly.
|
|
|
|
|
|
|
|
Fixes ruby/prism#2250.
Co-Authored-By: Kevin Newton <kddnewton@gmail.com>
|
|
Fixes ruby/prism#2279.
|
|
For zsuper calls with a keyword splat but no actual keywords, the
keyword splat is passed directly, so it cannot be mutable, because
if the callee accepts a keyword splat, changes to the keyword splat
by the callee would be reflected in the caller.
While here, simplify the logic when the method supports
literal keywords. I don't think it is possible for
a method with has_kw param flags to not have keywords, so add an
assertion for that, and set VM_CALL_KW_SPLAT_MUT in a single place.
|
|
|
|
|
|
|
|
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
|
In my windows environment uses cp932 for terminal encoding.
|
|
This allows ... argument forwarding to benefit from Allocationless
Anonymous Splat Forwarding, allowing the `f` call below to not
allocate an array or a hash.
```ruby
a = [1]
kw = {b: 2}
def c(a, b:)
end
def f(...)
c(...)
end
f(*a, **kw)
```
This temporarily skips prism locals tests until prism is changed
to use * and ** for ..., instead of using ruby2_keywords.
Ignore failures in rbs bundled gems tests, since they fail due
to this change.
|
|
|
|
|
|
Fixes ruby/prism#2248.
|
|
Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
|
|
Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
|
|
Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
|
|
Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
|
|
We need to make sure there is enough room in the local table for
repeated `*_` parameters
Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
|
|
Ensure there is enough space in the local table for repeated optional
parameters.
Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
|
|
Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
|
|
Fixes ruby/prism#2253.
|
|
Fixes ruby/prism#2262.
|
|
It seems to work with RUBY_ISEQ_DUMP_DEBUG=to_binary so we can try this
test again on CI.
|
|
Prism provides an index (local_body_index) which is supposed to point at
the start of locals declared in the method body. Prism assumed that
method body locals would only occur _after_ parameter names.
Unfortunately this assumption is not correct, which meant that we would
in some cases not insert all locals in the local table. This commit
iterates over locals a second time, inserting any that didn't get
inserted on the first pass.
Fixes: https://github.com/ruby/prism/issues/2245
Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
|
|
Fixes ruby/prism#2256.
|
|
Fixes ruby/prism#2247.
|
|
Fixes ruby/prism#2257.
|
|
|
|
Fixes ruby/prism#2249.
|
|
|
|
[Bug #20194]
When disabling the TracePoint on bmethod, the hooks list is not freed.
For example:
obj = Object.new
obj.define_singleton_method(:foo) {}
bmethod = obj.method(:foo)
tp = TracePoint.new(:return) {}
10.times do
100_000.times do
tp.enable(target: bmethod) {}
end
puts `ps -o rss= -p #{$$}`
end
Before:
18208
22832
26528
29728
34000
37776
40864
44400
47680
51504
After:
16688
17168
17168
17248
17696
17760
17824
17824
17856
17920
|
|
We need to set a special flag on block iseqs when there is a trailing
comma.
Fixes: https://github.com/ruby/prism/issues/2244
|
|
We weren't checking the right offsets when compiling methods with
keyword parameters that had complex code.
Fixes: https://github.com/ruby/prism/issues/2228
|
|
Fixes ruby/prism#2236.
|
|
|
|
Fixes ruby/prism#2223.
|
|
When we're compiling begin / rescue / ensure nodes, we need to "wrap"
the code in the begin statements correctly. The wrapping is like this:
(ensure code (rescue code (begin code)))
This patch pulls the each leg in to its own function, then calls the
appropriate wrapping function depending on whether there are ensure /
rescue legs.
Fixes: https://github.com/ruby/prism/issues/2221
|
|
Fixes ruby/prism#2232 and ruby/prism#2234.
|