| Age | Commit message (Collapse) | Author |
|
|
|
|
|
If a character literal was followed by a string concatenation, then
the forced encoding of the string concatenation could accidentally
overwrite the explicit encoding of the character literal. We now
handle this properly.
https://github.com/ruby/prism/commit/125c375d74
|
|
|
|
This reverts commit https://github.com/ruby/prism/commit/4052d93cf852, reversing
changes made to https://github.com/ruby/prism/commit/47143d17b3f7.
https://github.com/ruby/prism/commit/f117ec6354
|
|
Fixes [Bug #21256]
Co-Authored-By: Earlopain <14981592+Earlopain@users.noreply.github.com>
|
|
It depends on ostruct gem that is no longer a part of the default
gems, and the all tests are just skipped with a warning.
|
|
|
|
|
|
|
|
Prism implemented https://bugs.ruby-lang.org/issues/20925 but
parse.y doesn't seem to support it yet and is failing related Prism tests
on CI.
This adds excludes for the tests that are failing.
|
|
|
|
This was a limitation of parse.y that prism intentionally replicated.
https://github.com/ruby/prism/commit/8fd12d594c
|
|
https://github.com/ruby/prism/commit/3f58fa7705
|
|
Since cb419e3912f0514b8151469b0a4a4b83cbbcce78 we're no longer testing
this case because foo is redefined on obj1.
|
|
Continue processing only when OSSL_DECODER_from_bio() returns the error
code ERR_R_UNSUPPORTED. Otherwise, raise an exception without retrying
decoding the input in another format.
This fixes another case where OpenSSL::PKey.read prompts for a
passphrase multiple times when the input contains multiple
passphrase-protected PEM blocks and the first one cannot be decoded.
I am not entirely sure if the error code ERR_R_UNSUPPORTED is considered
part of the public interface of OpenSSL, but this seems to be the only
option available and is the approach used internally by the
PEM_read_bio_*() functions.
Fixes https://github.com/ruby/openssl/issues/927
https://github.com/ruby/openssl/commit/985ba27d63
|
|
Specify OSSL_DECODER_CTX_set_pem_password_cb() only when we expect a
passphrase-protected private key.
OSSL_DECODER appears to try to decrypt every PEM block in the input even
when the PEM header does not match the requested selection. This can
cause repeated prompts for a passphrase in a single OpenSSL::PKey.read
call.
https://github.com/ruby/openssl/commit/933503f49f
|
|
Add tests covering edge cases in the current behavior to prevent
accidental regressions. The next patches will update the OpenSSL 3.x
path.
https://github.com/ruby/openssl/commit/468f8ceea2
|
|
|
|
|
|
TestRubyOptimization#test_block_given_aset_aref
|
|
|
|
Fix: https://github.com/ruby/json/pull/853
Simplecov end up requiring json so we need to start collecting
coverage before.
https://github.com/ruby/json/commit/ca72019fd3
|
|
Previously, the included test crashed or turned into an infinite
loop due to the missing check.
|
|
The same also applies to `break`/`next`.
https://bugs.ruby-lang.org/issues/21540
https://github.com/ruby/prism/commit/3a38b192e3
|
|
```
1) Error:
JSONGenericObjectTest#test_from_hash:
Test::Unit::ProxyError: uninitialized constant JSON::GenericObject
/Users/hsbt/Documents/github.com/ruby/ruby/.ext/common/json/common.rb:1006:in 'JSON.const_missing'
/Users/hsbt/Documents/github.com/ruby/ruby/test/json/json_generic_object_test.rb:8:in 'JSONGenericObjectTest#setup'
```
|
|
This reverts commit 8aa885c460aeb70878538eebdd155c6318989fd2 and
cd07c3cbae7e287350d713ead237aeef27cc2b9e.
|
|
Test SubArrayWrapper#[] and SubOpenStruct#[]
https://github.com/ruby/json/commit/bae760aa19
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
|
|
https://github.com/ruby/json/commit/a9e05d6ff3
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
|
|
https://github.com/ruby/json/commit/efc61682ee
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
|
|
The gem root was including the test/ directory, so lines from tests were
skipped, and the deprecation warnings were shown as coming from the test
framework.
https://github.com/ruby/json/commit/2ec31a7363
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
|
|
https://github.com/ruby/json/commit/7a2a24d663
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
|
|
https://github.com/ruby/json/commit/f37e73cf44
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
|
|
The test introduced in 928fea3 is leaking files because the Tempfile is
not cleaned when the process exits. We see this in the output:
Children under /var/folders/51/_yzlsvf96v9729jtj8_mcp7w0000gn/T/rubytest.7lbdlp:
* -rw------- 1 0 2025-09-10 10:09:51 -0400 test20250910-13775-g4op87.rb
* -rw------- 1 0 2025-09-10 10:09:51 -0400 test20250910-13775-pu621v.rb
* -rw------- 1 0 2025-09-10 10:09:51 -0400 test20250910-13775-4xv688.rb
* -rw------- 1 0 2025-09-10 10:09:51 -0400 test20250910-13775-1rvp4b.rb
|
|
ZJIT: Support invokeblock insn
Basically like other send-ish insns, except that it doesn't pop the receiver.
|
|
|
|
[Bug #21567]
When we require an object that is not a string, it will attempt to convert
it to a string by calling to_str on it. If we modify the $LOADED_FEATURES
array while it calls to_str, Ruby can crash because it can end up inserting
the string in the wrong index in the array.
For example, the following script crashes:
require "tempfile"
class MyString
def initialize(path)
@path = path
end
def to_str
$LOADED_FEATURES.clear
@path
end
def to_path = @path
end
def create_ruby_file = Tempfile.create(["test", ".rb"]).path
require MyString.new(create_ruby_file)
$LOADED_FEATURES.unshift(create_ruby_file)
$LOADED_FEATURES << MyString.new(create_ruby_file)
require create_ruby_file
Crash log:
test.rb:21: [BUG] Segmentation fault at 0x0000000000000004
ruby 3.5.0dev (2025-09-09T09:29:35Z master ce94add7fb) +PRISM [arm64-darwin24]
-- Crash Report log information --------------------------------------------
See Crash Report log file in one of the following locations:
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
for more details.
Don't forget to include the above Crash Report log file in bug reports.
-- Control frame information -----------------------------------------------
c:0003 p:---- s:0011 e:000010 CFUNC :require
c:0002 p:0076 s:0006 e:000005 EVAL test.rb:21 [FINISH]
c:0001 p:0000 s:0003 E:0001b0 DUMMY [FINISH]
-- Ruby level backtrace information ----------------------------------------
test.rb:21:in '<main>'
test.rb:21:in 'require'
-- Threading information ---------------------------------------------------
Total ractor count: 1
Ruby thread count for this ractor: 1
-- Machine register context ------------------------------------------------
x0: 0x0000000000000004 x1: 0x000000000000c800 x2: 0x0000000000000000
x3: 0x0000000000000000 x4: 0x0000000000000205 x5: 0x0000000000000000
x6: 0x0000000000000000 x7: 0x0000000000000001 x18: 0x0000000000000000
x19: 0x0000000209dfc0b0 x20: 0x0000000209dfc018 x21: 0x000000016ee8ab58
x22: 0x0fffffff0009d71d x23: 0x0000000209dfc018 x24: 0x0000000209dfc150
x25: 0x000000016ee8acc0 x26: 0x0000000000000000 x27: 0x0000000000000000
x28: 0x0000000000000000 lr: 0x0000000101244140 fp: 0x000000016ee887f0
sp: 0x000000016ee887d0
-- C level backtrace information -------------------------------------------
miniruby(rb_print_backtrace+0x24) [0x101317b08] vm_dump.c:843
miniruby(rb_print_backtrace) (null):0
miniruby(rb_vm_bugreport+0x26c) [0x101317d94] vm_dump.c:1175
miniruby(rb_bug_for_fatal_signal+0xa4) [0x10105ddac] error.c:1130
miniruby(sig_do_nothing+0x0) [0x1012278c0] signal.c:948
miniruby(sigsegv) (null):0
/usr/lib/system/libsystem_platform.dylib(_sigtramp+0x38) [0x19c1216a4]
miniruby(rb_str_new_frozen+0x1c) [0x101244140] string.c:1495
miniruby(rb_check_realpath_internal+0x68) [0x101077804] file.c:4679
miniruby(rb_check_realpath+0x2c) [0x101077aa4] file.c:4765
miniruby(get_loaded_features_index+0x37c) [0x1010f9c94] load.c:467
miniruby(rb_feature_p+0xd0) [0x1010f8174] load.c:582
miniruby(search_required+0xac) [0x1010f6ad4] load.c:1193
miniruby(require_internal+0x274) [0x1010f7518] load.c:1424
miniruby(rb_require_string_internal+0x94) [0x1010f6830] load.c:1571
miniruby(rb_require_string+0x58) [0x1010f66e8] load.c:1557
miniruby(rb_f_require+0x1c) [0x1010f6684] load.c:1150
miniruby(ractor_safe_call_cfunc_1+0x38) [0x101306c28] vm_insnhelper.c:3696
miniruby(vm_call_cfunc_with_frame_+0x250) [0x1012f857c] vm_insnhelper.c:3873
miniruby(vm_call_cfunc_with_frame+0x6c) [0x1012f8834] vm_insnhelper.c:3919
miniruby(vm_sendish+0x1a8) [0x1012c990c] vm_insnhelper.c:6087
miniruby(vm_exec_core+0x4050) [0x1012cfb48] insns.def:900
miniruby(vm_exec_loop+0x80) [0x1012e5448] vm.c:2666
miniruby(rb_vm_exec+0x134) [0x1012c9b40] vm.c:2645
miniruby(rb_iseq_eval_main+0x34) [0x1012e5628] vm.c:2919
miniruby(rb_ec_exec_node+0xe4) [0x10106d094] eval.c:282
miniruby(ruby_run_node+0x94) [0x10106cf64] eval.c:320
miniruby(rb_main+0x40) [0x100f7499c] main.c:42
miniruby(main+0x60) [0x100f74928] main.c:62
|
|
|
|
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
|
|
* failing test for ObjToString optimization with GuardType
* profile ObjToString receiver and rewrite with guard
* adjust integration tests for objtostring type guard optimization
* Implement new GuardTypeNot HIR; objtostring sends to_s directly on profiled nonstrings
* codegen for GuardTypeNot
* typo fixes
* better name for tests; fix side exit reason for GuardTypeNot
* revert accidental change
* make bindgen
* Fix is_string to identify subclasses of String; fix codegen for identifying if val is String
|
|
This allows for more precise tracking of stats programmatically
which is particularly useful for our nightly benchmarking suite.
- Define rust function
- Expose to C
- Wrap with Ruby API
- Add a test
|
|
|
|
Similar to YJIT's --yjit-stats=quiet, this option allows ZJIT to collect
statistics and make them available via the Ruby API without printing them
at exit. This is useful for programmatic access to stats without the
output noise.
- Added print_stats field to Options struct
- Modified option parsing to support --zjit-stats=quiet
- Added rb_zjit_print_stats_p primitive to check if stats should be printed
- Updated zjit.rb to only register at_exit handler when print_stats is true
- Update the help text shown by `ruby --help` to indicate that
--zjit-stats now accepts an optional =quiet parameter.
- Added test for --zjit-stats=quiet option
|
|
Probably due to the testing order, sometimes it looks like that
`Gem::UnknownCommandError` happens to be used without registered in
`DidYouMean`.
|
|
* Revert "Debug: More inspections"
e5a6e952467eef5444eaf63b77d8c91aa367d4de.
* Revert "Debug for sporadical failures on RubyCI"
7cafc61e7df044644f47937694c46835c316e86b.
|
|
|
|
|
|
Using IO#each_codepoint together with IO#ungetc causes an unwanted exception when encoding conversion is active.
C:\>ruby -e "open('NUL', 'rt') { |f| f.ungetc('aa'); f.each_codepoint { |c| p c }}"
97
-e:1:in 'IO#each_codepoint': byte oriented read for character buffered IO (IOError)
from -e:1:in 'block in <main>'
from -e:1:in 'Kernel#open'
from -e:1:in '<main>'
Fixes [Bug #21131]
|
|
If #to_proc is defined, this uses the following error message format,
matching the error message format used for * when to_a returns non-Array
and for ** when to_hash returns non-Hash:
```
can't convert ClassName to Proc (ClassName#to_proc gives OtherClassName)
```
If #to_proc is not defined, this uses the following error message format,
matching the error message format used when ** is called on a non-Hash
not implementing to_hash.
```
no implicit conversion of ClassName into Proc
```
There isn't a similar error for * when called on a non-Array not
implementing to_a, as Ruby does not raise for that case.
Fixes [Bug #21563]
|
|
|