Caused by 04a92a6764. This treats
unbounded ranges of arbitrary objects the same as how unbounded
string ranges are treated:
(..x) === y # (y <=> x) <= 0
(...x) === y # (y <=> x) < 0
(x..) === y # (x <=> y) <= 0
Fixes [Bug #19864]
This commit changes the node template to create a dispatcher class,
which can be used to walk an AST an emit events to all registered
listeners
https://github.com/ruby/yarp/commit/03a45f85e6
Co-authored-by: Kevin Newton <kddnewton@users.noreply.github.com>
This simplifies how we handle multi-targets, and also fixes a bug we
had where for loops were always getting multi-targets, even when there
was only a single target.
https://github.com/ruby/yarp/commit/31eb8b7ad5
This rarely used node holds information about the local variables
that need to get written in the case a regular expression is used on
the left-hand side of a =~ operator and it has named capture groups.
Note that we already "handled" these nodes by adding locals to the
AST, but we didn't actually expose this information, making it
difficult to compile.
The general idea behind this node is that it maintains the ability
for consumers to find all of the call nodes in the tree easily so
it's not flattening down. However, it should be okay because you
hopefully don't need any information in the call node to determine
what to compile because the locals list is on the top level.
https://github.com/ruby/yarp/commit/e136e7f9a8
* Fix `io_buffer_get_string` default length computation.
When an offset bigger than the size is given, the resulting length will be
computed incorrectly. Raise an argument error in this case.
* Validate all arguments.
`Process::Status#&` and `Process::Status#>>` are provided only for
the backward compatibility with older Ruby than 1.8 where `$?` was
a `Fixnum`, and the knowledge about internals of system dependent
macros is necessary to use them. Modern programs and libraries
should not need these methods.
Always test only the scripts just under “lib", and just under
child directories which has not the same name script in the upper
level; instead of random sampling from whole libraries.
Previously, Kernel#lambda returned a non-lambda proc when given a
non-literal block and issued a warning under the `:deprecated` category.
With this change, Kernel#lambda will always return a lambda proc, if it
returns without raising.
Due to interactions with block passing optimizations, we previously had
two separate code paths for detecting whether Kernel#lambda got a
literal block. This change allows us to remove one path, the hack done
with rb_control_frame_t::block_code introduced in 85a337f for supporting
situations where Kernel#lambda returned a non-lambda proc.
[Feature #19777]
Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
These are replacements for regular expressions when they are used
alone as the predicate of a conditional. That's because they are
significantly different from a regular expression because they are
not evaluated for truthyness, but instead evaluated as a match
against the last line read by an IO object.
https://github.com/ruby/yarp/commit/0f1c7780e8
The flags integer is an implementation detail. We want people to
use the query methods to access the individual fields so we are
freed from having to maintain a specific order. As such, this
commit changes the Ruby API to mark all flags fields as private
attr_readers.
The only one that has a clear use case is returning the set of
options given to regular expressions, to mirror the Regexp#options
API. So, to support this use case, this commit introduces
RegularExpressionNode#options and InterpolatedRegularExpressionNode#options.
These APIs provide back the same integer so that they can be used
interchangeably.
https://github.com/ruby/yarp/commit/4e6d5dd99f
This test creates a lot of Objects held in an array, and a set of weak
references to them using WeakMap. It then clears the array and frees it
and asserts that all the weak references to it are also gone.
This test is failing because one of the dummy objects in our weakmap is
ending up on the stack, and so is being marked, even though we thought
that we'd removed the only reference to it.
This behaviour has changed since this commit:
5b5ae3d9e0
which rewrites `Integer#times` from C into Ruby. This change is somehow
causing the last object we append to our array to consistently end up on
the stack during GC.
This commit fixes the specific weakmap test by using an enumerator and
each, instead of `Integer#times`, and thus avoids having our last object
created end up on the stack.
The parser now passes around `yp_diagnostic_id_t` for diagnostic
messages instead of character strings, and we rely on the function
`diagnostic_message()` to resolve that to a string.
In addition, many messages were edited so that the parser expresses
coordinate ideas in similar form [1] using consistent voice and
typographic conventions.
Closes https://github.com/ruby/yarp/pull/1379, and makes progress on #941.
[1] Strunk & White rule 19
https://github.com/ruby/yarp/commit/0b6dd85bf1
Before this commit, constants in the constant pool were assumed to
be slices of the source string. This works in _almost_ all cases.
There are times, however, when a string needs to be synthesized.
This can occur when passing in locals that need to be scoped through
eval, or when generating method names like `foo=`.
After this commit, there is a single bit `owned` boolean on
constants in the pool that indicates whether or not it is a slice
of the source string. If it is not, it is assumed to be allocated
memory that should be freed by the constant pool when the constant
pool is freed.
When serializing, the most significant bit in the location of the
contents of the constant indicates whether or not it is owned.
When it is, instead of 4 bytes for the source offset and 4 bytes
for the length it is instead 4 bytes for the buffer offset and 4
bytes the length. The contents of the owned constants are embedded
into the buffer after the constant pool itself.
https://github.com/ruby/yarp/commit/461c047365
`ppc64le` appears to be struggling with this test due to timeout. Let's see
if reducing the number of iterations can help improve the test performance.
This test sometimes fails with:
```
1) Failure:
TestProcess#test_warmup_frees_pages [test/ruby/test_process.rb:2750]:
<202> expected but was
<203>.
```
Check that OpenSSL::PKey::EC.builtin_curves returns an array in the
expected format.
Similarly to OpenSSL::Cipher.ciphers, OpenSSL::PKey::EC.builtin_curves
returns a list of known named curves rather than actually usable ones.
https://github.com/ruby/openssl/issues/671 found that the list may
include unapproved (and thus unusable) curves when the FIPS module is
loaded.
https://github.com/ruby/openssl/commit/c53cbabe00