| Age | Commit message (Collapse) | Author |
|
Update the test case to explicitly load both the "default" and the
"legacy" providers.
Currently, the "default" provider as a side effect by the
OpenSSL::PKey::DH.new call in lib/openssl/ssl.rb. It will be cleaned up
in a following patch.
https://github.com/ruby/openssl/commit/013db02fb2
|
|
type. Since a endless method is started with `=`, there was ambiguity here. We have to simply reject these in all cases.
This adds a new error for the following reason:
* `def foo arg = nil` is interpreted as a normal method call with optional `arg` without matching `end`
* `def foo *arg = nil; end` is interpreted as a endless method call that has body `nil` with extraneous `end`
`def foo *arg = nil` is somewhere inbetween and I don't know how to otherwise indicate the error.
Now the second case above also shows the newly added error message.
Fixes [Bug #21623]
https://github.com/ruby/prism/commit/e1910d4492
|
|
https://github.com/ruby/error_highlight/commit/5f976265ef
|
|
* For having the common set of loaded libraries between root and main namespaces
* To have the consistent $LOADED_FEATURES in the main namespace
|
|
|
|
Fix CVE-2025-27221.
https://hackerone.com/reports/3221142
https://github.com/ruby/uri/commit/5cec76b9e8
|
|
to https://github.com/ruby/prism/commit/c89ca2af12ba20b4fd2c5ff43ebe25da1d81d8db
|
|
$ make test/ruby/test_thread.rb RUBYOPT=-w >/dev/null
test/ruby/test_thread.rb:1595: warning: assigned but unused variable - bug21127
|
|
|
|
https://github.com/ruby/date/commit/545066ca28
|
|
https://github.com/ruby/date/commit/159e1ebb7f
https://github.com/ruby/date/commit/4f7b6c9b42
|
|
https://github.com/ruby/json/commit/d7baf015d9
|
|
Just like ASAN, when running with LSAN, we also want to set handle_segv=0
in assert_segv to make sure that the tests pass.
|
|
TODO: Revert when dropping Ruby 2.7 support.
https://github.com/ruby/pp/commit/feb417e152
|
|
https://github.com/ruby/pp/commit/40b713d70f
|
|
(https://github.com/ruby/pp/pull/43)
Ruby 3.5 will use `Set[1, 2, 3]`. This updates pp to use the same format.
https://github.com/ruby/pp/commit/507eebf711
|
|
* It was showing on require 'pp':
lib/pp.rb:525: warning: constant ::Data is deprecated
* Fixes https://github.com/ruby/pp/issues/51
https://github.com/ruby/pp/commit/4fd8f4e0bb
|
|
This supports the new `instance_variables_to_inspect` method from Ruby
core that was added in ruby/ruby#13555.
If `instance_variables_to_inspect` is defined, then
`pretty_print_instance_variables` will use it.
Additionally, this commit introduces tests for both
`pretty_print_instance_variables` and `instance_variables_to_inspect`.
https://github.com/ruby/pp/commit/9cea466c95
|
|
* ZJIT: Add NoSingletonClass patch point
This patch point makes sure that when the object has a singleton class,
the JIT code is invalidated. As of now, this is only needed for C call
optimization.
In YJIT, the singleton class guard only applies to Array, Hash, and String.
But in ZJIT, we may optimize C calls from gems (e.g. `sqlite3`). So the
patch point needs to be applied to a broader range of classes.
* ZJIT: Only generate NoSingletonClass guard when the type can have singleton class
* ZJIT: Update or forget NoSingletonClass patch point when needed
|
|
When multiple files with the same name are required, the features_index
hash stores the indexes in `$LOADED_FEATURES` array into a darray.
The dest and src arguments for `MEMMOVE` were wrongly reversed when
inserting a new index in the darray.
[Bug #21568]
|
|
$ rake test >/dev/null
/tmp/test/test_ipaddr.rb:202: warning: IPAddr#ipv4_compat is obsolete
https://github.com/ruby/ipaddr/commit/31d62407c2
|
|
This re-applies https://github.com/ruby/ruby/pull/14629 / 40bb47665d3ff57e0f2eb5a9fd9e0109617015c9 by reverting https://github.com/ruby/ruby/pull/14673 / d4393772b89dab4f33c118a284d92dc80cd63c39.
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
|
|
- Generate smaller parameters in test_new_generate. Generating 2048-bit
parameters is slow and sometimes takes a few minutes on GitHub-hosted
CI runners. Also test the DH.generate alias, not just DH.new.
- Simplify test_new_break to just check exceptions raised in the block
because it is redundant.
- Remove unnecessary OpenSSL::PKey::DH#public_key calls.
- Update bare "assert" with more appropriate methods.
https://github.com/ruby/openssl/commit/8bc7442310
|
|
OpenSSL 3.0
Raise ArgumentError if this is attempted when the extension is compiled
with OpenSSL 3.0 or later. The form will be fully removed when we drop
support for OpenSSL 1.1.1.
When OpenSSL::PKey::{DH,DSA,EC,RSA}.new is called without any arguments,
it sets up an empty corresponding low-level struct and wraps it in an
EVP_PKEY. This is useful when the user later fills the missing fields
using low-level setter methods such as OpenSSL::PKey::RSA#set_key.
Such setter methods are not compatible with OpenSSL 3.0 or later, where
EVP_PKEY is immutable once created. This means that the ability to
create an empty instance is useless.
https://github.com/ruby/openssl/commit/affd569f78
|
|
CI passed on SetIvar but broke some larger Ruby tests. Needs further investigation and testing.
* Revert "ZJIT: Fix rebase issue with tests"
This reverts commit 37248c51233d827ca56471661175c56e31c3b14f.
* Revert "ZJIT: Inline attr_accessor/attr_writer to SetIvar (#14629)"
This reverts commit 40bb47665d3ff57e0f2eb5a9fd9e0109617015c9.
|
|
|
|
https://github.com/ruby/ipaddr/commit/7c85bb8dfd
Co-authored-by: Tietew <tietew@gmail.com>
|
|
|
|
Mutexes were being improperly unlocked on thread cleanup. This bug was
introduced in 050a8954395.
We must keep a reference from the mutex to the thread, because if the fiber
is collected before the mutex is, then we cannot unlink it from the thread in
`mutex_free`. If it's not unlinked from the the thread when it's freed, it
causes bugs in `rb_thread_unlock_all_locking_mutexes`.
We now mark the fiber when a mutex is locked, and the thread is marked
as well. However, a fiber can still be freed in the same GC cycle as the
mutex, so the reference to the thread is still needed.
The reason we need to mark the fiber is that `mutex_owned_p()` has an ABA
issue where if the fiber is collected while it's locked, a new fiber could be
allocated at the same memory address and we could get false positives.
Fixes [Bug #21342]
Co-authored-by: John Hawthorn <john@hawthorn.email>
|
|
* ZJIT: Incorporate bb0-prologue and PC check into HIR
* Fix an outdated comment
* Use shallow clone for LoadPC and EntryPoint
* Reproduce the actual HIR graph to pass validation
* Fill out param types for jit_entry_block
* Add Type::from_cptr
* Add a TODO comment about Const::CPtr printing
|
|
call-seq:
Ractor.sharable_proc(self: nil){} -> sharable proc
It returns shareable Proc object. The Proc object is
shareable and the self in a block will be replaced with
the value passed via `self:` keyword.
In a shareable Proc, the outer variables should
* (1) refer shareable objects
* (2) be not be overwritten
```ruby
a = 42
Ractor.shareable_proc{ p a }
#=> OK
b = 43
Ractor.shareable_proc{ p b; b = 44 }
#=> Ractor::IsolationError because 'b' is reassigned in the block.
c = 44
Ractor.shareable_proc{ p c }
#=> Ractor::IsolationError because 'c' will be reassigned outside of the block.
c = 45
d = 45
d = 46 if cond
Ractor.shareable_proc{ p d }
#=> Ractor::IsolationError because 'd' was reassigned outside of the block.
```
The last `d`'s case can be relaxed in a future version.
The above check will be done in a static analysis at compile time,
so the reflection feature such as `Binding#local_varaible_set`
can not be detected.
```ruby
e = 42
shpr = Ractor.shareable_proc{ p e } #=> OK
binding.local_variable_set(:e, 43)
shpr.call #=> 42 (returns captured timing value)
```
Ractor.sharaeble_lambda is also introduced.
[Feature #21550]
[Feature #21557]
|
|
The validation is relevant only for traceable userland ruby objects ruby
code could interact with. ZJIT's use of rb_vm_method_cfunc_is()
allocates a CC imemo and was failing this validation when it was
actually fine. Relax the check.
|
|
|
|
## Context
#14409
https://github.com/ruby/ruby/pull/14409#discussion_r2350238583
>You may have noticed that this doesn't produce a New range instruction. For that you probably need to use a local variable (makes it harder for the bytecode compiler to reason about, but the JIT sees through it). If you have time, please rewrite these tests.
https://github.com/ruby/ruby/pull/14409#discussion_r2350240389
>There's some code above to do this for you: see arguments_likely_fixnums and coerce something or other
## Changes
### Refactor tests
Modify tests force the usage of `NewRangeFixnum` instruction and make tests names more consistent.
### Refactor optimize ranges
Didn't found `arguments_likely_fixnums` to be applicable unless we enable profiling for `NewRange` and change the criteria of when the optimization fires. But there were other ways to clean up the code.
Simplify the logic and move it to `type_specialize`. Deleted the standalone `optimize_ranges` function.
|
|
* See https://bugs.ruby-lang.org/issues/21613
|
|
The stack layout is incompatible with the way we reify the stack for
generating fallback SendWithoutBlock: the receiver is an embedded VALUE
in the bytecode, not on the stack. Since we don't expect these to be
overridden often, instead of fussing about with the stack layout, just
hope for the best and PatchPoint/SideExit.
Fix https://github.com/Shopify/ruby/issues/760
|
|
https://github.com/ruby/prism/commit/d1b22f59a0
|
|
https://github.com/ruby/prism/commit/cb27f5a70a
|
|
arguments
https://bugs.ruby-lang.org/issues/21168#note-5
The added code samples align with `parse.y`, except for `foo(bar baz do end)` which `parse.y` currently rejects but shouldn't.
https://github.com/ruby/prism/commit/3a4e102d80
|
|
e.g.
```ruby
{ 1 => 2 }
```
The callback will be invoked for `1` as while it has a native JSON
equivalent, it's not legal as an object name.
|
|
Fix: https://github.com/ruby/json/issues/861
It's not incorrect to use scientific notation, but it tend
to throw people off a bit, so it's best to keep it for very large
numbers.
https://github.com/ruby/json/commit/1566cd01a6
|
|
Fix: https://github.com/ruby/json/issues/859
https://github.com/ruby/json/commit/67ebabec75
Co-Authored-By: Jean Boussier <jean.boussier@gmail.com>
|
|
https://github.com/ruby/json/commit/08b9eb0ee6
|
|
to prevent implicit file discovery missing files.
https://github.com/ruby/json/commit/6bded942c4
|
|
https://github.com/ruby/json/commit/5855f4f603
|
|
* ZJIT: Compile sendforward with dynamic dispatch
* Reload locals only if it has blockiseq
* Add a test case of ... with other args
|
|
If another ractor is calling for GC, we need to prevent the current one
from joining the barrier. Otherwise, our half-built object will be marked.
The repro script was:
test.rb:
```ruby
require "objspace"
1000.times do
ObjectSpace.trace_object_allocations do
r = Ractor.new do
_obj = 'a' * 1024
end
r.join
end
end
```
$ untilfail lldb -b ./exe/ruby -o "target create ./exe/ruby" -o "run test.rb" -o continue
It would fail at `ractor_port_mark`, rp->r was a garbage value. Credit to John for finding the
solution.
Co-authored-by: John Hawthorn <john.hawthorn@shopify.com>
|
|
* ZJIT: Support variadic C calls
This reduces the `dynamic_send_count` in `liquid-render` by ~21%
* ZJIT: Reuse gen_push_frame
* ZJIT: Avoid optimizing variadic C call when tracing is enabled
|
|
The test is no longer useful since
5c7dfe85a1dc49334e2828791f0ade42eee662db because Module#initialize_copy
is empty/not defined anymore.
|
|
|