89061 Commits

Author SHA1 Message Date
Nobuyoshi Nakada
1df52e097b
yasmdata.rb is no longer generated for years [ci skip] 2024-12-02 09:07:25 +09:00
Kouhei Yanagita
ae59b44041 [ruby/set] Fix ^ to respect subclasses
https://github.com/ruby/set/commit/f88ecdef6b
2024-12-02 08:28:58 +09:00
Kouhei Yanagita
f2334cf4b1 [ruby/set] Speed up Set#flatten
Improved performance by ensuring that identical `Set` objects are
processed only once.

https://github.com/ruby/set/commit/cadb686e93
2024-12-02 08:28:44 +09:00
Nobuyoshi Nakada
96fac34797
Win32: Accept slashes in --with-opt-dir argument 2024-12-01 17:31:10 +09:00
Nobuyoshi Nakada
029174a402
Win32: Use the symbolic name for the default NTVER
And embed the given `_WIN32_WINNT` in config.h as well, for extension
libraries.
2024-12-01 10:13:35 +09:00
Nobuyoshi Nakada
091c7d4a54
Win32: Make waring 4013 error
```
'function' undefined; assuming extern returning int
The compiler encountered a call to an undefined function.
```
2024-12-01 10:13:34 +09:00
tomoya ishida
0fc70022e6 [ruby/reline] Call user defined sigwinch and sigcont handler
(https://github.com/ruby/reline/pull/788)

https://github.com/ruby/reline/commit/7d44770c84
2024-11-30 17:21:20 +00:00
Mari Imaizumi
569f27b425 [ruby/irb] Prevent cursor flickering
(https://github.com/ruby/irb/pull/1041)

https://github.com/ruby/irb/commit/0506ed0e11
2024-11-30 16:22:05 +00:00
Mike Dalessio
83bd9191d8 [ruby/rdoc] Methods are sorted symbols-first
(https://github.com/ruby/rdoc/pull/1219)

There are three distinct ranges of symbols in ASCII:

- the range below "A", 0..64 in decimal
- the range between "Z" and "a", 91..96 in decimal
- the range above "z", 123..127 in decimal

With this change, any method starting with a character in these
"symbol ranges" will be sorted before a method starting with an alpha
ASCII character. The remaining methods, all starting with alpha or
8-bit characters, will be sorted against each other exactly as before.

Specifically this addresses the issue from #1204 which is that `#[]`
and `#^` were previously sorted _after_ the alpha methods. These
methods will now be sorted before alpha methods.

Fixes https://github.com/ruby/rdoc/pull/1204

https://github.com/ruby/rdoc/commit/a4f13d242b
2024-11-30 16:06:54 +00:00
Nobuyoshi Nakada
c321cf0e95
Revert useless VPATH for NMAKE [ci skip] 2024-11-30 23:57:42 +09:00
Pascal Terjan
da03ab62e6 [ruby/reline] Fix tests failing when INPUTRC is defined
(https://github.com/ruby/reline/pull/789)

Failure: test_empty_xdg_config_home(Reline::Config::Test)
/home/pterjan/reline/test/reline/test_config.rb:563:in `test_empty_xdg_config_home'
     560:     expected = File.expand_path('~/.config/readline/inputrc')
     561:     FileUtils.mkdir_p(File.dirname(expected))
     562:     FileUtils.touch(expected)
  => 563:     assert_equal expected, @config.inputrc_path
     564:   ensure
     565:     FileUtils.rm(expected)
     566:     ENV['XDG_CONFIG_HOME'] = xdg_config_home_backup
<"/tmp/test_reline_config_4131165/.config/readline/inputrc"> expected but was
<"/etc/inputrc">

https://github.com/ruby/reline/commit/7de5a50f63
2024-11-30 14:42:31 +00:00
Mike Dalessio
2923f42ed7 [ruby/rdoc] fix: C variables should never show up in Ancestors tree
(https://github.com/ruby/rdoc/pull/1217)

If a NormalClass's superclass is a C enclosure, then update the
superclass to point to the RDoc::NormalClass.

This is done in a single pass after all files have been parsed.

Fixes https://github.com/ruby/rdoc/pull/1205.

https://github.com/ruby/rdoc/commit/1ecd9581b1
2024-11-30 12:31:42 +00:00
Misaki Shioi
3d07754ee2
Improve the conditions for clearing the Connection Attempt Delay upon connection failure (#12223)
* Improve the conditions for clearing the Connection Attempt Delay upon connection failure

This change addresses a case that was overlooked in ruby/ruby#12087.
In the previous change, the Connection Attempt Delay was cleared at the point of a connection failure only if both of the following conditions were met:

- No other sockets were attempting a connection
- There were addresses still available to start a new connection

In this update, the second condition has been removed.
As a result, if name resolution succeeds after a connection failure and new addresses are obtained, it will be able to immediately attempt a connection to one of them.

If there are no sockets attempting a connection, no addresses available for connection, and name resolution has completed, an exception will still be raised as before.

---

Additionally, the following minor fixes have been made:

* Refactor: Remove unnecessary members
2024-11-30 18:51:53 +09:00
Nobuyoshi Nakada
fdf60d735c
Win32: Fix dependencies with VPATH on nmake 2024-11-30 15:24:30 +09:00
Nobuyoshi Nakada
ed9fff67f0
Win32: Accept a symbolic name for --with-ntver option 2024-11-30 15:21:51 +09:00
jeremyd2019
4745338a3f [win32] fix arm64 instruction decoding
Two minor fixes to arm64 instruction decoding when looking for __pioinfo:
1. add_mask was shifted by one bit, it was intended to be 0x7f800000.  However, since the mask was already excluding matching the 'sh' bit, and since the purpose of the add following the adrp is to add in the lower 12 bits, I opted to set the mask to 0x7fc00000 and simply remove the handling for the 12 bit shift option which is now required to be disabled in order to match.
2. adrp's immediate was supposed to be sign extended.  So far, I have not seen cases where the global variable ends up before the code in memory, but it's a possibility, so handle the sign extension.
2024-11-30 14:22:55 +09:00
Nobuyoshi Nakada
8149f4d6ab [Bug #20910] dtrace related symbols are not considered leaked 2024-11-30 14:04:53 +09:00
John Hawthorn
f1dda5ed01 Warn when redefining __id__ as well as object_id
[Feature #20912]
2024-11-29 20:41:00 -08:00
John Hawthorn
a505cd32fb RUBY_DEBUG: Verify PC correctness every alloc 2024-11-29 20:37:27 -08:00
viralpraxis
660b995365 [Bug #20915] Fix SEGV with TracePoint#parameters and aliased C method
The following snippet results with a SEGV:

```ruby
C = Class.new do
  alias_method :new_to_s, :to_s
end

TracePoint.new(:c_call, &:parameters).enable { C.new.new_to_s }
```

at MRI 3.3.6 and ruby 3.4.0dev

The root cause of the issue lies in the `rb_tracearg_parameters` function
within the `RUBY_EVENT_C_RETURN` branch. Specifically, when the invoked
method is an alias for a C function,
`rb_method_entry_without_refinements(..., trace_arg->called_id, ...)`
may return NULL. In that case we can fallback to `trace_arg->id`.
2024-11-29 18:42:48 -05:00
Alan Wu
88764dde78 [DOC] Rewrite docs for rb_sym2str()
Explaining this by reference to rb_id2str() obscures a few important
details because IDs and symbols don't map to each other perfectly (you
can have a dynamic symbol without an ID!) Also, it used to take 2
redirections to get to concrete information, and I think being more
direct is friendlier.
2024-11-29 18:33:44 -05:00
Alan Wu
2a0006c101 [DOC] Mention that rb_id2str() returns a frozen string 2024-11-29 18:33:44 -05:00
Alan Wu
2fc357c16d YJIT: Avoid std::ffi::CString with rb_intern2() during boot
Fewer allocations on boot, too.

Suggested-by: https://github.com/ruby/ruby/pull/12217
2024-11-29 16:45:22 -05:00
Durable Programming Team
36a98307aa [rubygems/rubygems] make pretty_print tests whitespace agnostic
https://github.com/rubygems/rubygems/commit/23e9396d22
2024-11-29 19:29:15 +00:00
tomoya ishida
7e02410bf8 [ruby/reline] Don't skip start_with check on encoding-incompatible
candidates
(https://github.com/ruby/reline/pull/787)

https://github.com/ruby/reline/commit/8588be652f
2024-11-29 19:07:35 +00:00
Mari Imaizumi
c06dcba964 [ruby/reline] Fix RELINE_TEST_ENCODING
(https://github.com/ruby/reline/pull/743)

* Fix RELINE_TEST_ENCODING

It was not working because it was not environment variable.

* Fix Encoding::CompatibilityError: Shift_JIS is not compatible with UTF-8

Error: test_completion_append_character(Reline::KeyActor::EmacsTest): Encoding::CompatibilityError: Shift_JIS is not compatible with UTF-8
/home/runner/work/reline/reline/lib/reline/line_editor.rb:814:in 'block in Reline::LineEditor#filter_normalize_candidates'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:808:in 'Array#select'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:808:in 'Reline::LineEditor#filter_normalize_candidates'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:831:in 'Reline::LineEditor#perform_completion'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:1434:in 'Reline::LineEditor#complete'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:961:in 'Method#call'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:961:in 'Reline::LineEditor#wrap_method_call'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:1029:in 'block in Reline::LineEditor#process_key'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:932:in 'Reline::LineEditor#run_for_operators'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:1028:in 'Reline::LineEditor#process_key'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:1051:in 'Reline::LineEditor#normal_char'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:1089:in 'Reline::LineEditor#input_key'
/home/runner/work/reline/reline/test/reline/helper.rb:124:in 'block in Reline::TestCase#input_keys'
/home/runner/work/reline/reline/test/reline/helper.rb:117:in 'Array#each'
/home/runner/work/reline/reline/test/reline/helper.rb:117:in 'Reline::TestCase#input_keys'
/home/runner/work/reline/reline/test/reline/test_key_actor_emacs.rb:948:in 'Reline::KeyActor::EmacsTest#test_completion_append_character'
===============================================================================
===============================================================================
Error: test_continuous_completion_disabled_with_perfect_match(Reline::KeyActor::EmacsTest): Encoding::CompatibilityError: Shift_JIS is not compatible with UTF-8
/home/runner/work/reline/reline/lib/reline/line_editor.rb:814:in 'block in Reline::LineEditor#filter_normalize_candidates'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:808:in 'Array#select'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:808:in 'Reline::LineEditor#filter_normalize_candidates'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:831:in 'Reline::LineEditor#perform_completion'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:1434:in 'Reline::LineEditor#complete'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:961:in 'Method#call'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:961:in 'Reline::LineEditor#wrap_method_call'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:1029:in 'block in Reline::LineEditor#process_key'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:932:in 'Reline::LineEditor#run_for_operators'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:1028:in 'Reline::LineEditor#process_key'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:1051:in 'Reline::LineEditor#normal_char'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:1089:in 'Reline::LineEditor#input_key'
/home/runner/work/reline/reline/test/reline/helper.rb:124:in 'block in Reline::TestCase#input_keys'
/home/runner/work/reline/reline/test/reline/helper.rb:117:in 'Array#each'
/home/runner/work/reline/reline/test/reline/helper.rb:117:in 'Reline::TestCase#input_keys'
/home/runner/work/reline/reline/test/reline/test_key_actor_emacs.rb:936:in 'Reline::KeyActor::EmacsTest#test_continuous_completion_disabled_with_perfect_match'
===============================================================================
===============================================================================
Error: test_continuous_completion_with_perfect_match(Reline::KeyActor::EmacsTest): Encoding::CompatibilityError: Shift_JIS is not compatible with UTF-8
/home/runner/work/reline/reline/lib/reline/line_editor.rb:814:in 'block in Reline::LineEditor#filter_normalize_candidates'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:808:in 'Array#select'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:808:in 'Reline::LineEditor#filter_normalize_candidates'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:831:in 'Reline::LineEditor#perform_completion'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:1434:in 'Reline::LineEditor#complete'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:961:in 'Method#call'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:961:in 'Reline::LineEditor#wrap_method_call'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:1029:in 'block in Reline::LineEditor#process_key'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:932:in 'Reline::LineEditor#run_for_operators'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:1028:in 'Reline::LineEditor#process_key'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:1051:in 'Reline::LineEditor#normal_char'
/home/runner/work/reline/reline/lib/reline/line_editor.rb:1089:in 'Reline::LineEditor#input_key'
/home/runner/work/reline/reline/test/reline/helper.rb:124:in 'block in Reline::TestCase#input_keys'
/home/runner/work/reline/reline/test/reline/helper.rb:117:in 'Array#each'
/home/runner/work/reline/reline/test/reline/helper.rb:117:in 'Reline::TestCase#input_keys'
/home/runner/work/reline/reline/test/reline/test_key_actor_emacs.rb:924:in 'Reline::KeyActor::EmacsTest#test_continuous_completion_with_perfect_match'
===============================================================================
Finished in 2.118582151 seconds.
385 tests, 1762 assertions, 0 failures, 3 errors, 0 pendings, 3 omissions, 0 notifications

https://github.com/ruby/reline/commit/4df825c48f
2024-11-29 18:15:46 +00:00
Yusuke Endoh
7f34c75b8b Use RSTRING_PTR instead of StringValuePtr
... since it is certain to be a String in this context.

Also, I want to avoid the anxious use of `StringValuePtr(str)` and
`RSTRING_LEN(str)` as arguments in the same function call.
2024-11-30 03:15:03 +09:00
Peter Zhu
f65a6c090c Fix use-after-free in constant cache
[Bug #20921]

When we create a cache entry for a constant, the following sequence of
events could happen:

- vm_track_constant_cache is called to insert a constant cache.
- In vm_track_constant_cache, we first look up the ST table for the ID
  of the constant. Assume the ST table exists because another iseq also
  holds a cache entry for this ID.
- We then insert into this ST table with the iseq_inline_constant_cache.
- However, while inserting into this ST table, it allocates memory, which
  could trigger a GC. Assume that it does trigger a GC.
- The GC frees the one and only other iseq that holds a cache entry for
  this ID.
- In remove_from_constant_cache, it will appear that the ST table is now
  empty because there are no more iseq with cache entries for this ID, so
  we free the ST table.
- We complete GC and continue our st_insert. However, this ST table has
  been freed so we now have a use-after-free.

This issue is very hard to reproduce, because it requires that the GC runs
at a very specific time. However, we can make it show up by applying this
patch which runs GC right before the st_insert to mimic the st_insert
triggering a GC:

    diff --git a/vm_insnhelper.c b/vm_insnhelper.c
    index 3cb23f06f0..a93998136a 100644
    --- a/vm_insnhelper.c
    +++ b/vm_insnhelper.c
    @@ -6338,6 +6338,10 @@ vm_track_constant_cache(ID id, void *ic)
            rb_id_table_insert(const_cache, id, (VALUE)ics);
        }

    +    if (id == rb_intern("MyConstant")) rb_gc();
    +
        st_insert(ics, (st_data_t) ic, (st_data_t) Qtrue);
    }

And if we run this script:

    Object.const_set("MyConstant", "Hello!")

    my_proc = eval("-> { MyConstant }")
    my_proc.call

    my_proc = eval("-> { MyConstant }")
    my_proc.call

We can see that ASAN outputs a use-after-free error:

    ==36540==ERROR: AddressSanitizer: heap-use-after-free on address 0x606000049528 at pc 0x000102f3ceac bp 0x00016d607a70 sp 0x00016d607a68
    READ of size 8 at 0x606000049528 thread T0
        #0 0x102f3cea8 in do_hash st.c:321
        #1 0x102f3ddd0 in rb_st_insert st.c:1132
        #2 0x103140700 in vm_track_constant_cache vm_insnhelper.c:6345
        #3 0x1030b91d8 in vm_ic_track_const_chain vm_insnhelper.c:6356
        #4 0x1030b8cf8 in rb_vm_opt_getconstant_path vm_insnhelper.c:6424
        #5 0x1030bc1e0 in vm_exec_core insns.def:263
        #6 0x1030b55fc in rb_vm_exec vm.c:2585
        #7 0x1030fe0ac in rb_iseq_eval_main vm.c:2851
        #8 0x102a82588 in rb_ec_exec_node eval.c:281
        #9 0x102a81fe0 in ruby_run_node eval.c:319
        #10 0x1027f3db4 in rb_main main.c:43
        #11 0x1027f3bd4 in main main.c:68
        #12 0x183900270  (<unknown module>)

    0x606000049528 is located 8 bytes inside of 56-byte region [0x606000049520,0x606000049558)
    freed by thread T0 here:
        #0 0x104174d40 in free+0x98 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x54d40)
        #1 0x102ada89c in rb_gc_impl_free default.c:8183
        #2 0x102ada7dc in ruby_sized_xfree gc.c:4507
        #3 0x102ac4d34 in ruby_xfree gc.c:4518
        #4 0x102f3cb34 in rb_st_free_table st.c:663
        #5 0x102bd52d8 in remove_from_constant_cache iseq.c:119
        #6 0x102bbe2cc in iseq_clear_ic_references iseq.c:153
        #7 0x102bbd2a0 in rb_iseq_free iseq.c:166
        #8 0x102b32ed0 in rb_imemo_free imemo.c:564
        #9 0x102ac4b44 in rb_gc_obj_free gc.c:1407
        #10 0x102af4290 in gc_sweep_plane default.c:3546
        #11 0x102af3bdc in gc_sweep_page default.c:3634
        #12 0x102aeb140 in gc_sweep_step default.c:3906
        #13 0x102aeadf0 in gc_sweep_rest default.c:3978
        #14 0x102ae4714 in gc_sweep default.c:4155
        #15 0x102af8474 in gc_start default.c:6484
        #16 0x102afbe30 in garbage_collect default.c:6363
        #17 0x102ad37f0 in rb_gc_impl_start default.c:6816
        #18 0x102ad3634 in rb_gc gc.c:3624
        #19 0x1031406ec in vm_track_constant_cache vm_insnhelper.c:6342
        #20 0x1030b91d8 in vm_ic_track_const_chain vm_insnhelper.c:6356
        #21 0x1030b8cf8 in rb_vm_opt_getconstant_path vm_insnhelper.c:6424
        #22 0x1030bc1e0 in vm_exec_core insns.def:263
        #23 0x1030b55fc in rb_vm_exec vm.c:2585
        #24 0x1030fe0ac in rb_iseq_eval_main vm.c:2851
        #25 0x102a82588 in rb_ec_exec_node eval.c:281
        #26 0x102a81fe0 in ruby_run_node eval.c:319
        #27 0x1027f3db4 in rb_main main.c:43
        #28 0x1027f3bd4 in main main.c:68
        #29 0x183900270  (<unknown module>)

    previously allocated by thread T0 here:
        #0 0x104174c04 in malloc+0x94 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x54c04)
        #1 0x102ada0ec in rb_gc_impl_malloc default.c:8198
        #2 0x102acee44 in ruby_xmalloc gc.c:4438
        #3 0x102f3c85c in rb_st_init_table_with_size st.c:571
        #4 0x102f3c900 in rb_st_init_table st.c:600
        #5 0x102f3c920 in rb_st_init_numtable st.c:608
        #6 0x103140698 in vm_track_constant_cache vm_insnhelper.c:6337
        #7 0x1030b91d8 in vm_ic_track_const_chain vm_insnhelper.c:6356
        #8 0x1030b8cf8 in rb_vm_opt_getconstant_path vm_insnhelper.c:6424
        #9 0x1030bc1e0 in vm_exec_core insns.def:263
        #10 0x1030b55fc in rb_vm_exec vm.c:2585
        #11 0x1030fe0ac in rb_iseq_eval_main vm.c:2851
        #12 0x102a82588 in rb_ec_exec_node eval.c:281
        #13 0x102a81fe0 in ruby_run_node eval.c:319
        #14 0x1027f3db4 in rb_main main.c:43
        #15 0x1027f3bd4 in main main.c:68
        #16 0x183900270  (<unknown module>)

This commit fixes this bug by adding a inserting_constant_cache_id field
to the VM, which stores the ID that is currently being inserted and, in
remove_from_constant_cache, we don't free the ST table for ID equal to
this one.

Co-Authored-By: Alan Wu <alanwu@ruby-lang.org>
2024-11-29 10:46:43 -05:00
David Rodríguez
73c4023c2d [rubygems/rubygems] Enable pending exec spec
This is how Ruby works, and it's not going to change. So let's run the
test since it makes no sense to keep it pending.

https://github.com/rubygems/rubygems/commit/5f78d3c737
2024-11-29 15:29:33 +00:00
David Rodríguez
d2e5994161 [rubygems/rubygems] Improve heredoc indentation in exec specs
https://github.com/rubygems/rubygems/commit/abb658757f
2024-11-29 15:29:32 +00:00
David Rodríguez
8b75164381 [rubygems/rubygems] Unify specs testing Bundler.setup failing behavior
They had slightly different behavior in Bundler 2 and Bundler 3 because
Bundler 3 will auto-clean after `bundle install`, so one of them system
installed gems won't be present when `Bundler.setup` fails.

We can unify the specs by moving installing system gems to _after_
`bundle install`, so the behavior in both cases is the same. Also, only
this spec actually needs these gems installed, so we can move that from
the `before` block to the body of the spec.

https://github.com/rubygems/rubygems/commit/b7251ec9c6
2024-11-29 15:29:32 +00:00
David Rodríguez
ee7ff4a12b [rubygems/rubygems] Backwards compatibility for 2.5.17-2.5.23 caches
https://github.com/rubygems/rubygems/commit/9dbfce76cf
2024-11-29 15:27:40 +00:00
David Rodríguez
9a4d91fa95 [rubygems/rubygems] Restore previous application cache format for git sources
And make sure `bundle install --local` can install from it without git.

https://github.com/rubygems/rubygems/commit/7d6b631620
2024-11-29 15:27:39 +00:00
David Rodríguez
2a8437a1eb [rubygems/rubygems] Check feature flag earlier
https://github.com/rubygems/rubygems/commit/33536aa61c
2024-11-29 15:27:38 +00:00
David Rodríguez
68c7e75349 [rubygems/rubygems] Remove unnecessary early return
These are never equal.

https://github.com/rubygems/rubygems/commit/69e369da74
2024-11-29 15:27:37 +00:00
David Rodríguez
34f6334bca [rubygems/rubygems] Improve naming in git sources
The "revision" attribute is actually getting the revision from the
Gemfile.lock file. So I think "locked" is a better term here to avoid
confusion with the revision checked out in `vendor/cache`.

https://github.com/rubygems/rubygems/commit/ca5bdebe1f
2024-11-29 15:27:34 +00:00
Yusuke Endoh
8aeb67de7d Remove a useless condition expression
`len` is always at least 1 here.
2024-11-30 00:03:07 +09:00
卜部昌平
705714be3e prefer ruby_memerror instead
This could be out of GVL
2024-11-29 23:19:05 +09:00
卜部昌平
25ad7e8e6c rb_gc_impl_malloc can return NULL
Let there be rooms for each GC implementations how to handle multi
threaded situations.  They can be totally reentrant, or can have
their own mutex, or can rely on rb_thread_call_with_gvl.

In any ways the allocator (has been, but now officially is)
expected to run properly without a GVL.  This means there need be
a way for them to inform the interpreter about their allocation
failures, without relying on raising exceptions.

Let them do so by returning NULL.
2024-11-29 23:19:05 +09:00
git
5067a46502 Update default gems list at ae85fc72717c5b6d13be101781d41a [ci skip] 2024-11-29 10:28:26 +00:00
Akinori MUSHA
ae85fc7271 [ruby/set] Bump VERSION to 1.1.1
https://github.com/ruby/set/commit/1c3cded76a
2024-11-29 10:27:25 +00:00
Misaki Shioi
49d2e79fb0
Ensure to close pipes when TCPSocket.new finishes processing (#12181)
`TCPSocket.new` with HEv2 uses three threads.
The last of these threads to exit closed pipes.
However, if pipes were open at the end of the main thread, they would leak.
This change avoids this by closing pipes at the end of the main thread.
2024-11-29 18:49:02 +09:00
Misaki Shioi
22e1a8c478
Allow disable to fast_fallback of TCPSocket.new (#12210)
with `Socket.tcp_fast_fallback=`
The functions that `Socket.tcp` had are now also available in `TCPSocket.new`.
2024-11-29 14:18:09 +09:00
Yusuke Endoh
f9d0bc22f5 Remove a useless check if fd is negative
If `slave` is negative, neither `dup2(slave,0)` or `close(slave)` should
be executed. I believe this check is completely useless.
2024-11-29 12:38:20 +09:00
Yusuke Endoh
a32981b6b8 Remove a useless check
Here `nb` should never be NULL. If it were, the following
`nb->buffer_list` would be strange.

A follow-up to ddd8da4b6ba3dfcca21ca710e7cef2fa3b9632d7
2024-11-29 12:27:04 +09:00
Nobuyoshi Nakada
43dd9c721f [ruby/date] Fix mixed declarations and code
This still support ruby 2.6 which does not require C99.

https://github.com/ruby/date/commit/61d849758f
2024-11-29 02:48:10 +00:00
Nobuyoshi Nakada
b910de641b [ruby/date] Suppress compound-token-split-by-macro warnings
It was used intentionally.

https://github.com/ruby/date/commit/291b40f939
2024-11-29 02:48:09 +00:00
Nobuyoshi Nakada
ad773b5e99 [ruby/time] [DOC] Make RDoc coverage 100%
https://github.com/ruby/time/commit/c668704413
2024-11-29 01:39:01 +00:00
Hiroshi SHIBATA
84b14c0385 Dont't need to run nmake test 2024-11-29 09:49:07 +09:00
Hiroshi SHIBATA
c392bec8cc Use only -j option for test option 2024-11-29 09:49:07 +09:00