| Age | Commit message (Collapse) | Author |
|
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
|
|
|
|
|
|
The order of iseq may differ from the order of tokens, typically
`while`/`until` conditions are put after the body.
These orders can match by using line numbers as builtin-indexes, but
at the same time, it introduces the restriction that multiple `cexpr!`
and `cstmt!` cannot appear in the same line.
Another possible idea is to use `RubyVM::AbstractSyntaxTree` and
`node_id` instead of ripper, with making BASERUBY 3.1 or later.
|
|
|
|
|
|
|
|
|
|
Fixes: ruby/prism#2212
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Because `--with-baseruby=/usr/bin/ruby` on macOS is Ruby 2.6,
I was confused why `--with-baseruby` was ignored.
|
|
|
|
|
|
The libruby.so linking extension libraries contain symbols exported
from extension libraries, and is not subject of test-leaked-globals.
|
|
The thing that has used this in the past was very buggy, and we've never
revisied it. Let's remove it until we need it again.
|
|
|
|
|
|
|
|
|
|
|
|
Before this commit the Prism compiler would try to intern constants
every time it re-entered. This pool of constants is "constant" (there is
only one pool per parser instance), so we should do it only once: upon
the top level entry to the compiler.
This change does just that: it populates the interned constants once.
Fixes: https://github.com/ruby/prism/issues/2152
|
|
We still need to emit an expand array even if there's no "left side"
variables
Fixes: https://github.com/ruby/prism/issues/2153
|
|
|
|
|
|
Previously on builds with optimizations disabled, this could result in
an out of bounds read. When we had all of:
* built with -O0
* Leaf builtin
* Primitive.mandatory_only
* "no args builtin", called by vm_call_single_noarg_inline_builti
* The stack is escaped to the heap via binding or a proc
This is because mk_builtin_loader generated reads for all locals
regardless of whether they were used and in the case we generated a
mandatory_only iseq that would include more variables than were actually
available.
On optimized builds, the invalid accesses would be optimized away, and
this also was often unnoticed as the invalid access would just hit
another part of the stack unless it had been escaped to the heap.
The fix here is imperfect, as this could have false positives, but since
Primitive.cexpr! is only available within the cruby codebase itself
that's probably fine as a proper fix would be much more challenging (the
only false positives we found were in rjit.rb).
Fixes [Bug #20178]
Co-authored-by: Adam Hess <HParker@github.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Unless this option is given, keep other gems that may be used by
`test-bundled-gems`.
|
|
|
|
For different version baseruby, use the target platform and version
instead of the info of baseruby.
|
|
|
|
`:sym` was managed by `NODE_LIT` with `Symbol` object.
This commit introduces `NODE_SYM` so that
1. Symbol literal is detectable from AST Node
2. Reduce dependency on ruby object
|
|
|
|
|
|
RDoc options that do not change and can be written in `.rdoc_options`
file are moved, so that they match when called without `make`.
Get rid of parsing the files in `page_dir` twice (as relative paths
and absolute paths).
|
|
|
|
Fixes [Bug #20104]
|
|
|