summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2025-08-07Add MODULE NODE locationsS-H-GAMELINKS
Add `keyword_module` amd `keyword_end` locations to struct `RNode_MODULE`. memo: ``` >ruby --dump=parsetree -e 'module A end' @ ProgramNode (location: (1,0)-(1,12)) +-- locals: [] +-- statements: @ StatementsNode (location: (1,0)-(1,12)) +-- body: (length: 1) +-- @ ModuleNode (location: (1,0)-(1,12)) +-- locals: [] +-- module_keyword_loc: (1,0)-(1,6) = "module" +-- constant_path: | @ ConstantReadNode (location: (1,7)-(1,8)) | +-- name: :A +-- body: nil +-- end_keyword_loc: (1,9)-(1,12) = "end" +-- name: :A ```
2025-08-06Struct: keep direct reference to IMEMO/fields when space allowsJean Boussier
It's not rare for structs to have additional ivars, hence are one of the most common, if not the most common type in the `gen_fields_tbl`. This can cause Ractor contention, but even in single ractor mode means having to do a hash lookup to access the ivars, and increase GC work. Instead, unless the struct is perfectly right sized, we can store a reference to the associated IMEMO/fields object right after the last struct member. ``` compare-ruby: ruby 3.5.0dev (2025-08-06T12:50:36Z struct-ivar-fields-2 9a30d141a1) +PRISM [arm64-darwin24] built-ruby: ruby 3.5.0dev (2025-08-06T12:57:59Z struct-ivar-fields-2 2ff3ec237f) +PRISM [arm64-darwin24] warming up..... | |compare-ruby|built-ruby| |:---------------------|-----------:|---------:| |member_reader | 590.317k| 579.246k| | | 1.02x| -| |member_writer | 543.963k| 527.104k| | | 1.03x| -| |member_reader_method | 213.540k| 213.004k| | | 1.00x| -| |member_writer_method | 192.657k| 191.491k| | | 1.01x| -| |ivar_reader | 403.993k| 569.915k| | | -| 1.41x| ``` Co-Authored-By: Étienne Barrié <etienne.barrie@gmail.com>
2025-08-06[rubygems/rubygems] Update tests to respect token for where v2 and v1 are ↵pjsk
invoked https://github.com/rubygems/rubygems/commit/261315e399
2025-08-06[rubygems/rubygems] removed global variablespjsk
https://github.com/rubygems/rubygems/commit/42c5947dbe
2025-08-06[rubygems/rubygems] implement fallbackpjsk
https://github.com/rubygems/rubygems/commit/e09a6ec815
2025-08-06[rubygems/rubygems] Surgery on test code to make fallback to imdsv1 easier ↵pjsk
to test https://github.com/rubygems/rubygems/commit/5b4eece722
2025-08-06[rubygems/rubygems] Deprecate Gem::Specification#datadir and will remove it ↵Hiroshi SHIBATA
at RG 4.1 https://github.com/rubygems/rubygems/commit/e99cdab171
2025-08-05[ruby/prism] Remove uneeded testS-H-GAMELINKS
https://github.com/ruby/prism/commit/a6b448b10f
2025-08-05[ruby/prism] Add it read and assignment testS-H-GAMELINKS
https://github.com/ruby/prism/commit/659d769621
2025-08-05[ruby/prism] Make `it = it` assign `nil` to match parse.y behavior [Bug #21139]S-H-GAMELINKS
Currently Prism returns `42` for code like this: ```ruby 42.tap { it = it; p it } # => 42 ``` But parse.y returns `nil`: ```ruby 42.tap { it = it; p it } # => nil ``` In parse.y, it on the right-hand side is parsed as a local variable. In Prism, it was parsed as the implicit block parameter it, which caused this inconsistent behavior. This change makes the right-hand side it to be parsed as a local variable, aligning with parse.y's behavior. Bug ticket: https://bugs.ruby-lang.org/issues/21139 https://github.com/ruby/prism/commit/cf3bbf9d2c
2025-08-05[ruby/prism] Ensure context terminators terminate expressionsKevin Newton
https://github.com/ruby/prism/commit/915f6b3ae9
2025-08-05[ruby/prism] Bump JRuby versionKevin Newton
https://github.com/ruby/prism/commit/27d284bbb8
2025-08-05[ruby/prism] Handle new ractor stuffKevin Newton
https://github.com/ruby/prism/commit/f5ded5104d
2025-08-05[ruby/prism] Improve error handling for missing parentheses after 'not' in ↵ydah
command calls https://github.com/ruby/prism/commit/d9151b8a82
2025-08-05[ruby/prism] Reject `true && not true`Yusuke Endoh
A command-call-like `not true` must be rejected after `&&` and `||`. https://bugs.ruby-lang.org/issues/21337 https://github.com/ruby/prism/commit/0513cf22ad
2025-08-05Check if the found pkg-config is usable actuallyNobuyoshi Nakada
2025-08-05Convert `PKG_CONFIG_PATH` to msys/cygwin pathNobuyoshi Nakada
2025-08-05Show mkmf.log contents even when `pkg-config` command failedNobuyoshi Nakada
2025-08-04Resurrect another ZJIT skip on test_handle_interrupted?Takashi Kokubun
Failed at: https://github.com/ruby/ruby/actions/runs/16737407508/job/47378992863 Partially reverting https://github.com/ruby/ruby/pull/14097
2025-08-04Resurrect a ZJIT skip on test_switch_while_busy_loopTakashi Kokubun
This can still hang: https://github.com/ruby/ruby/actions/runs/16735509694/job/47373381258 partially reverting https://github.com/ruby/ruby/pull/14097
2025-08-04ZJIT: Remove passing tests from exclusions (#14097)Stan Lo
2025-08-03[ruby/optparse] Expand literal home paths onlyNobuyoshi Nakada
Paths in environment variables should already be expanded. The base name of the program is also not subject to expansion. https://github.com/ruby/optparse/commit/181752391c
2025-08-03[ruby/optparse] Fallback HOMENobuyoshi Nakada
https://github.com/ruby/optparse/commit/e0fdabf946
2025-08-01ZJIT: Enable IncrCounter for arm64 (#14086)Takashi Kokubun
2025-08-01ZJIT: Fix side-exit panicking when there's too many localsAlan Wu
Previously, ARM64 panicked due to compiled_side_exits() when the memory displacement got large enough to exceed the 9 bits limit. Usually, we split these kind of memory operands, but compiled_side_exits() runs after split. Using scratch registers, implement `Insn::Store` on ARM such that it can handle large displacements without split(). Do this for x86 as well, and remove arch specific code from compiled_side_exits(). We can now run `TestKeywordArguments`. Since `Insn::Store` doesn't need splitting now, users enjoy lower register pressure. Downside is, using `Assembler::SCRATCH_REG` as a base register is now sometimes an error, depending on whether `Insn::Store` also needs to use the register. It seems a fair trade off since `SCRATCH_REG` is not often used, and we don't put it as a base register anywhere at the moment.
2025-08-01[ruby/prism] Avoid monkey patching Sexp#== in RubyParser testsJustin Collins
https://github.com/ruby/prism/commit/7362b114a3
2025-08-01[ruby/prism] RubyParser translation for stabby lambdas with `it`Justin Collins
https://github.com/ruby/prism/commit/c2e372a8d8
2025-08-01variable.c: Fix `rb_ivar_foreach` to not yield `object_id` of complex objectsJean Boussier
Co-Authored-By: Étienne Barrié <etienne.barrie@gmail.com>
2025-08-01[ruby/openssl] pkcs7: make PKCS7#add_recipient actually usefulKazuki Yamaguchi
Add a simple test case that creates an enveloped-data structure without using the shorthand method, and fix two issues preventing this from working correctly. First, OpenSSL::PKey::PKCS7#add_recipient currently inserts an incomplete PKCS7_RECIP_INFO object into the PKCS7 object. When duplicating an unfinalized PKCS7_RECIP_INFO, the internal X509 reference must also be copied, as it is later used by #add_data to fill the rest. A similar issue with #add_signer was fixed in commit https://github.com/ruby/openssl/commit/20ca7a27a86e (pkcs7: keep private key when duplicating PKCS7_SIGNER_INFO, 2021-03-24). Second, #add_data calls PKCS7_dataFinal(), which for enveloped-data appears to require the BIO to be flushed explicitly with BIO_flush(). Without this, the last block of the encrypted data would be missing. https://github.com/ruby/openssl/commit/9595ecf643
2025-08-01[ruby/openssl] pkcs7: fix error queue leak in OpenSSL::PKCS7#detachedKazuki Yamaguchi
Only call PKCS7_get_detached() if the PKCS7 object is a signed-data. This is only useful for the content type, and leaves an error entry if called on a PKCS7 object with a different content type. https://github.com/ruby/openssl/commit/8997f6d5e6
2025-08-01Fix rb_shape_transition_object_id transition to TOO_COMPLEXJean Boussier
If `get_next_shape_internal` fail to return a shape, we must transitiont to a complex shape. `shape_transition_object_id` mistakenly didn't. Co-Authored-By: Peter Zhu <peter@peterzhu.ca>
2025-07-31ZJIT: A64: Fix splitting for large memory displacementsAlan Wu
On the ruby side, this fixes a crash for methods with 39 or more parameters. We used to miscomp those entry points due to Insn::Lea picking ADDS which cannot reference SP: # set method params: 40 mov x0, #0xfee8 movk x0, #0xffff, lsl #16 movk x0, #0xffff, lsl #32 movk x0, #0xffff, lsl #48 adds x0, xzr, x0 Have Lea work for all i32 displacements and avoid involving the split pass. Previously, direct use of Insn::Lea directly from the user (as opposed to generated by the split pass for some memory operations) wasn't split, so being able to handle the whole range in arm64_emit() was implicitly required. Also, not going through split reduces register pressure.
2025-07-31[ruby/openssl] pkcs7: clean up testsKazuki Yamaguchi
This includes: - Update test keys to the generic rsa-{1,2,3}.pem. - Add omissions for enveloped-data tests so that the rest can be tested in the FIPS mode. - Add tests for PKCS7#error_string and #data. - Check more error paths. - Various style fixes. https://github.com/ruby/openssl/commit/58f0022de3
2025-07-31[ruby/openssl] x509store: fix StoreContext#current_certKazuki Yamaguchi
Commit https://github.com/ruby/openssl/commit/ef277083ba76 overlooked a caller of ossl_x509_new() with NULL argument. OpenSSL::X509::StoreContext#current_cert may not have a certificate to return if StoreContext#verify has not been called. https://github.com/ruby/openssl/commit/4149b43890
2025-07-30ZJIT: Prepare for sharing JIT hooks with ZJIT (#14044)Takashi Kokubun
2025-07-29[ruby/prism] Allow command calls in endless method bodies within assignmentsStan Lo
Previously, endless method definitions in assignment contexts like `x = def f = p 1` would fail to parse because command calls (method calls without parentheses) were only accepted when the surrounding binding power was less than `PM_BINDING_POWER_COMPOSITION`. This fix specifically checks for assignment context and allows command calls in those cases while maintaining the existing behavior for other contexts. This ensures that: - `x = def f = p 1` parses correctly (previously failed) - `private def f = puts "Hello"` still produces the expected error https://github.com/ruby/prism/commit/722af59ba3
2025-07-29Improve performance of bignum[beg, len] (#14007)tomoya ishida
Implement rb_big_aref2. Taking a small slice from large bignum was slow in rb_int_aref2.
2025-07-29[Bug #21513] Raise on converting endless range to setviralpraxis
ref: https://bugs.ruby-lang.org/issues/21513 Before this patch, trying to convert endless range (e.g. `(1..)`) to set (using `to_set`) would hang
2025-07-28ZJIT: Support invalidating constant patch points (#13998)Stan Lo
2025-07-28ZJIT: Keep a frame pointer and use it for memory paramsAlan Wu
Previously, ZJIT miscompiled the following because of native SP interference. def a(n1,n2,n3,n4,n5,n6,n7,n8) = [n8] a(0,0,0,0,0,0,0, :ok) Commented problematic disassembly: ; call rb_ary_new_capa mov x0, #1 mov x16, #0x1278 movk x16, #0x4bc, lsl #16 movk x16, #1, lsl #32 blr x16 ; call rb_ary_push mov x1, x0 str x1, [sp, #-0x10]! ; c_push() from alloc_regs() mov x0, x1 ; arg0, the array ldur x1, [sp] ; meant to be arg1=n8, but sp just moved! mov x16, #0x3968 movk x16, #0x4bc, lsl #16 movk x16, #1, lsl #32 blr x16 Since the frame pointer stays constant in the body of the function, static offsets based on it don't run the risk of being invalidated by SP movements. Pass the registers to preserve through Insn::FrameSetup. This allows ARM to use STP and waste no gaps between EC, SP, and CFP. x86 now preserves and restores RBP since we use it as the frame pointer. Since all arches now have a frame pointer, remove offset based SP movement in the epilogue and restore registers using the frame pointer.
2025-07-28[rubygems/rubygems] Avoid openssl bug in test_verify_certificate_extra_messageKazuki Yamaguchi
OpenSSL::X509::StoreContext#current_cert returns an empty and invalid OpenSSL::X509::Certificate instance if it is called before starting a certificate verification. https://redirect.github.com/ruby/openssl/pull/919 will change it to return nil instead in such a case. Adjust test_verify_certificate_extra_message to actually complete StoreContext#verify so that it will not rely on this behavior. https://github.com/rubygems/rubygems/commit/823799088d
2025-07-28[ruby/json] Fix duplicated key warning locationJean Boussier
Followup: https://github.com/ruby/json/pull/818 Now the warning should point at the `JSON.parse` caller, and not inside the json gem itself. https://github.com/ruby/json/commit/cd51557387
2025-07-28[ruby/json] Improve duplicate key warning and errors to include the key nameJean Boussier
Followup: https://github.com/ruby/json/pull/818 https://github.com/ruby/json/commit/e3de4cc59c
2025-07-28Update comments for pack/unpack tests [ci skip]Nobuyoshi Nakada
More comprehensive pack/unpack tests are in test_pack.rb.
2025-07-27Add test for `String#byteslice` with multibyte charactersErim Icel
2025-07-27[ruby/openssl] ssl: add post-quantum cryptography (PQC) testsJun Aruga
The key files were created by the following commands. ``` $ ${HOME}/.local/openssl-3.6.0-dev-fips-debug-8253b58d60/bin/openssl genpkey \ -algorithm mldsa65 \ -out mldsa65-1.pem $ ${HOME}/.local/openssl-3.6.0-dev-fips-debug-8253b58d60/bin/openssl genpkey \ -algorithm mldsa65 \ -out mldsa65-2.pem ``` PQC algorithms, ML-KEM (FIPS 203) and ML-DSA (FIPS 204) used in the PQC tests are supported on OpenSSL 3.5 or later. https://openssl-library.org/post/2025-04-08-openssl-35-final-release/ https://github.com/ruby/openssl/commit/f3bb316018
2025-07-24ZJIT: Remove redundant test exclusionsStan Lo
2025-07-25Add NODE_DEFINED tests for cases with parentheses to test_ast.rbydah
2025-07-24Add DEFINED NODE locationsS-H-GAMELINKS
Add keyword_defined locations to struct RNode_DEFINED
2025-07-23ZJIT: Add multiple exclude targetsStan Lo