Commit graph

93142 commits

Author SHA1 Message Date
Peter Zhu
1055e04e28 Remove useless set of dest_shape_id in rb_obj_copy_ivar 2025-07-31 23:22:25 -04:00
Takashi Kokubun
543f8dcad3
ZJIT: Add the ISEQ name to Block asm comments (#14070) 2025-07-31 14:28:08 -07:00
Alan Wu
5a7be72c06 Also include shape type in assert
The assert also fails on interpreter-only runs:
4714861028
2025-07-31 16:23:24 -04:00
Takashi Kokubun
12306c0c6f
ZJIT: Stub JIT-to-JIT calls (#14052) 2025-07-31 12:57:59 -07:00
Jean Boussier
f0c31c5e64 Get rid of RSHAPE_PARENT in favor of RSHAPE_DIRECT_CHILD_P
`RSHAPE_PARENT` is error prone because it returns a raw untagged
shape_id.

To check if a shape is a direct parent of another, tags should be
discarded. So providing a comparison function is better than exposing
untagged ids.
2025-07-31 21:55:51 +02:00
Alan Wu
84ee71df45 Print shape id when a flaky shapes assert fails
This has been failing intermittently during
`test_marshal_with_ivar_and_id` for ZJIT and YJIT builds.

4714097060
4714140911
2025-07-31 15:30:46 -04:00
Alan Wu
da0de3cb87 ZJIT: A64: Fix splitting for large memory displacements
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 13:45:20 -04:00
Alan Wu
0aabbbe31d ZJIT: Remove false comment [ci skip] 2025-07-31 13:45:20 -04:00
Alan Wu
214d587a77 ZJIT: Only build the assembler for target_arch
Fixes test error from running the ARM assembler on x86, but then trying
to disassemble it as x86.
2025-07-31 13:45:20 -04:00
Alan Wu
dd352461da ZJIT: A64: Add add_extended() which can add a register to sp 2025-07-31 13:45:20 -04:00
Kazuki Yamaguchi
865a6191d0 [ruby/openssl] pkcs7: clean up tests
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.

58f0022de3
2025-07-31 17:38:36 +00:00
Kazuki Yamaguchi
69ff8f736b [ruby/openssl] pkcs7: only set error_string in the error path
Set the error_string attribute to nil if PKCS7_verify() succeeds, since
the error queue should be empty in that case.

With AWS-LC, OpenSSL::PKCS#verify currently sets error_string to
"invalid library (0)" when the verification succeeds, whereas with
OpenSSL and LibreSSL, it becomes nil. ERR_reason_error_string() appears
to behave differently when an invalid error code is passed.

The branch to raise OpenSSL::PKCS7::PKCS7Error is removed because it
does not appear to be reachable.

c11c6631fa
2025-07-31 17:38:35 +00:00
Peter Zhu
771804248e Make ARGF not pin references during marking
ARGF supports compaction, but it pins all of its references, which means
that none of it can move. This commit changes it to actually support
compaction.
2025-07-31 12:46:51 -04:00
Nobuyoshi Nakada
b3598cf2a3 Win: Strip CRs from cpp and nm output
The combination of mingw tools and cygin/msys2 ruby leaves CRs.
2025-08-01 00:15:27 +09:00
Peter Zhu
6c24904a69 Make static symbol ID atomic
We don't need the VM lock if we make static symbol IDs atomic.
2025-07-31 11:09:03 -04:00
Nobuyoshi Nakada
68a03167a5 Suppress maybe-uninitialized warnings 2025-07-31 23:07:08 +09:00
Peter Zhu
05353ab4b7 Make cross_ractor_require write barrier protected 2025-07-31 09:14:22 -04:00
BurdetteLamar
6f7a4f9c96 [DOC] Tweaks for String#getbyte 2025-07-31 09:14:11 -04:00
BurdetteLamar
d7bc1378d2 [DOC] Tweaks for String#force_encoding 2025-07-31 09:13:57 -04:00
BurdetteLamar
6d466a55bd [DOC] Tweaks for String#eql? 2025-07-31 09:13:36 -04:00
BurdetteLamar
ff6a8e95b7 [DOc] Tweaks for String#end_with? 2025-07-31 09:13:20 -04:00
Burdette Lamar
e2bd36388f
[DOC] Tweak for String#encode 2025-07-31 09:13:01 -04:00
Kazuki Yamaguchi
0d3d296b85 Reapply "[ruby/openssl] x509: disallow ossl_x509{,attr,crl,ext,revoked,name}*_new(NULL)"
This reverts commit ec01cd9bbb.

This should no longer break the tests, now that the following changes
have been applied:

 - RubyGems change: 32977f3869
 - ruby/openssl change: e8261963c7
2025-07-31 18:45:53 +09:00
Kazuki Yamaguchi
e8261963c7 [ruby/openssl] x509store: fix StoreContext#current_cert
Commit ef277083ba 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.

4149b43890
2025-07-31 09:45:35 +00:00
Hiroya Fujinami
18f500e347
Fix indents in Onigmo files to use spaces instead of tabs (#14047) [no ci] 2025-07-31 13:08:54 +09:00
Hiroshi SHIBATA
064e74087c
Also added arch variable to download-cache keys 2025-07-31 12:23:43 +09:00
Hiroshi SHIBATA
92ca64ab80
Added prefix for key of GH cache since download-cache is created four times with the same name. 2025-07-31 11:31:30 +09:00
Hiroshi SHIBATA
47b8916576
Save vcpkg cache with master and stable branches 2025-07-31 10:36:23 +09:00
Peter Zhu
7cece235ab Don't check the symbol's fstr at shutdown
During Ruby's shutdown, we no longer need to check the fstr of the symbol
because we don't use the fstr anymore for freeing the symbol. This can also
fix the following ASAN error:

==2721247==ERROR: AddressSanitizer: use-after-poison on address 0x75fa90a627b8 at pc 0x64a7b06fb4bc bp 0x7ffdf95ba9b0 sp 0x7ffdf95ba9a8
READ of size 8 at 0x75fa90a627b8 thread T0
    #0 0x64a7b06fb4bb in RB_BUILTIN_TYPE include/ruby/internal/value_type.h:191:30
    #1 0x64a7b06fb4bb in rb_gc_shutdown_call_finalizer_p gc.c:357:18
    #2 0x64a7b06fb4bb in rb_gc_impl_shutdown_call_finalizer gc/default/default.c:3045:21
    #3 0x64a7b06fb4bb in rb_objspace_call_finalizer gc.c:1739:5
    #4 0x64a7b06ca1b2 in rb_ec_finalize eval.c:165:5
    #5 0x64a7b06ca1b2 in rb_ec_cleanup eval.c:256:5
    #6 0x64a7b06c98a3 in ruby_cleanup eval.c:179:12
2025-07-30 13:57:32 -04:00
Max Bernstein
75f25e5c49 ZJIT: Don't create owned Cow/String when printing 2025-07-30 10:36:15 -07:00
Max Bernstein
1b700c56d8 ZJIT: Don't make unnecessary Cow 2025-07-30 10:36:15 -07:00
Max Bernstein
8c73b103cd ZJIT: Don't write to String 2025-07-30 10:36:15 -07:00
Max Bernstein
0f7ee8e7a4 ZJIT: Get rid of CallInfo 2025-07-30 10:36:15 -07:00
Max Bernstein
096d48d7db ZJIT: Deref struct in find() 2025-07-30 10:36:15 -07:00
Max Bernstein
7b10dbd55f ZJIT: Remove catch-all case to make it clearer what's unimplemented 2025-07-30 10:36:15 -07:00
Max Bernstein
9a30554796 ZJIT: Remove unused ArraySet instruction 2025-07-30 10:36:15 -07:00
John Hawthorn
0aac763bf0 Convert cross_ractor_requires to DECL_MARKING 2025-07-30 10:18:28 -07:00
Takashi Kokubun
2cd10de330
ZJIT: Prepare for sharing JIT hooks with ZJIT (#14044) 2025-07-30 10:11:10 -07:00
Stan Lo
4263c49d1c
YJIT: Remove a dead test for getinlinecaches (#14033)
The test was added in #5221 4 years ago but:

1. The insn it targets was removed in 2022 in #6187
2. The YJIT API `blocks_for` seems to be dropped in 2022 when it switched
   to use Rust in #5826

So this test has not been run in more than 3 years and can't be run
anymore. I think we can remove it.
2025-07-30 09:33:25 -07:00
Peter Zhu
74887a2c12 [ruby/mmtk] Skip weak references that are special consts
If a reference marked weak becomes a special const, it will crash because
it is not a GC handled object. We should skip special consts here.

870a79426b
2025-07-30 13:26:19 +00:00
Hiroya Fujinami
66bcb69054
Port Oniguruma patches to prevent integer overflow (#14027)
* Port a Oniguruma patch: Integer overflow in forward_search_range()

db64ef3189

Co-Authored-By: K.Kosako <kkos@users.noreply.github.com>

* Port a Oniguruma patch: Integer overflow in backward_search_range() and onig_search_gpos()

bfc36d3d81

Co-Authored-By: K.Kosako <kkos@users.noreply.github.com>

* Port a Oniguruma patch: Integer overflow in onig_search_gpos()

778a43dd56

It differs from the Oniguruma patch in that it dosen't use `onigenc_get_prev_char_head()`
because this function's signature has been changed by Oniguruma and the change is not ported
in Onigmo for now. This patch respects the current Onigmo implementation.

Co-Authored-By: K.Kosako <kkos@users.noreply.github.com>

* Add castings to prevent warnings

* Correct castings to use OnigDistance

---------

Co-authored-by: K.Kosako <kkos@users.noreply.github.com>
2025-07-30 20:56:13 +09:00
Jean Boussier
cbe5241c77 [DOC] Mention that Hash#replace also replaces defaults 2025-07-30 10:40:34 +02:00
David Rodríguez
e2fbd01714 [rubygems/rubygems] Remove unnecessary endless loop detection
Fixes a TODO now that no reports have been reported in a while.

f10dc84e7b
2025-07-30 11:19:32 +09:00
David Rodríguez
862b30287a [rubygems/rubygems] Bump vendored thor to 1.4.0
8078a747b3
2025-07-30 11:19:30 +09:00
David Rodríguez
124cd77470 [rubygems/rubygems] Keep fixture Gemfiles in sync when bumping version
781443cb0f
2025-07-30 11:19:28 +09:00
dependabot[bot]
2ec5e70fdb [rubygems/rubygems] Bump thor in /bundler/spec/realworld/fixtures/tapioca
Bumps [thor](https://github.com/rails/thor) from 1.3.2 to 1.4.0.
- [Release notes](https://github.com/rails/thor/releases)
- [Commits](https://github.com/rails/thor/compare/v1.3.2...v1.4.0)

---
updated-dependencies:
- dependency-name: thor
  dependency-version: 1.4.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

0a4e5a377d
2025-07-30 11:19:27 +09:00
David Rodríguez
e42f1aaa5a [rubygems/rubygems] Fix truffleruby failing to install sorbet-static when there's no lockfile
The generic Ruby platform was getting unconditionally added in
truffleruby, preventing resolution in situations where there's no
generic ruby version (sorbet-static). Instead, the generic platform
should be considered per dependency, not globally.

a96afc5351
2025-07-30 11:19:26 +09:00
David Rodríguez
15e9dc19fb [rubygems/rubygems] Remove JRuby workaround
Original issue was fixed in JRuby 9.3.0.0, which seems old enough for us
to remove the workaround.

d285148d39
2025-07-30 11:19:24 +09:00
David Rodríguez
a0b501effe [rubygems/rubygems] Remove out of date TODO
After digging into git history a bit, I figure this was about unifying
`bundle cache` and `bundle package`, which already happened a while ago.
So remove this TODO since it's now misleading.

5a0b06b84d
2025-07-30 11:19:23 +09:00
Peter Zhu
1a4c0a9913 [ruby/mmtk] Fix warnings from cargo fmt
84975a8840
2025-07-29 21:45:11 +00:00