From c8977e9064c9d3e73515b5ed39ef3ef6557517c0 Mon Sep 17 00:00:00 2001 From: git Date: Tue, 11 Nov 2025 06:53:52 +0000 Subject: [PATCH 1/6] Update bundled gems list as of 2025-11-11 --- NEWS.md | 2 +- gems/bundled_gems | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 37bf4bcd2372c2..76786bed8d66dc 100644 --- a/NEWS.md +++ b/NEWS.md @@ -170,7 +170,7 @@ The following bundled gems are promoted from default gems. * rdoc 6.15.1 * win32ole 1.9.2 * irb 1.15.3 -* reline 0.6.2 +* reline 0.6.3 * readline 0.0.4 * fiddle 1.1.8 diff --git a/gems/bundled_gems b/gems/bundled_gems index 67385af0a6222b..e7b5091bcc7e2e 100644 --- a/gems/bundled_gems +++ b/gems/bundled_gems @@ -42,6 +42,6 @@ logger 1.7.0 https://github.com/ruby/logger rdoc 6.15.1 https://github.com/ruby/rdoc win32ole 1.9.2 https://github.com/ruby/win32ole irb 1.15.3 https://github.com/ruby/irb -reline 0.6.2 https://github.com/ruby/reline +reline 0.6.3 https://github.com/ruby/reline readline 0.0.4 https://github.com/ruby/readline fiddle 1.1.8 https://github.com/ruby/fiddle From 66ecd00c19ed712243c4ee54dab32a8826f0bd81 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Tue, 11 Nov 2025 14:22:16 +0900 Subject: [PATCH 2/6] Support out-of-place build in ruby/ruby repo --- spec/bundler/support/builders.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/spec/bundler/support/builders.rb b/spec/bundler/support/builders.rb index 4eaf40e1bf2888..5ca227cf5b3aa3 100644 --- a/spec/bundler/support/builders.rb +++ b/spec/bundler/support/builders.rb @@ -425,13 +425,11 @@ def required_ruby_version=(*reqs) end class BundlerBuilder - SPEC = Gem::Specification.load(Spec::Path.relative_gemspec) - def initialize(context, name, version) raise "can only build bundler" unless name == "bundler" @context = context - @spec = SPEC.dup + @spec = Spec::Path.loaded_gemspec.dup @spec.version = version || Bundler::VERSION end From c5bd4acd30320a8e180ce9fcb24acdab4e10c73a Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 6 Nov 2025 20:24:24 +0900 Subject: [PATCH 3/6] [Bug #21666] Get rid of use of unspecified values --- spec/ruby/core/math/lgamma_spec.rb | 11 ++++------- test/ruby/test_math.rb | 12 +++++++++++- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/spec/ruby/core/math/lgamma_spec.rb b/spec/ruby/core/math/lgamma_spec.rb index 33e78364488c70..2bf350993e57f8 100644 --- a/spec/ruby/core/math/lgamma_spec.rb +++ b/spec/ruby/core/math/lgamma_spec.rb @@ -5,10 +5,8 @@ Math.lgamma(0).should == [infinity_value, 1] end - platform_is_not :windows do - it "returns [Infinity, 1] when passed -1" do - Math.lgamma(-1).should == [infinity_value, 1] - end + it "returns [Infinity, ...] when passed -1" do + Math.lgamma(-1)[0].should == infinity_value end it "returns [Infinity, -1] when passed -0.0" do @@ -47,8 +45,7 @@ Math.lgamma(infinity_value).should == [infinity_value, 1] end - it "returns [NaN, 1] when passed NaN" do - Math.lgamma(nan_value)[0].nan?.should be_true - Math.lgamma(nan_value)[1].should == 1 + it "returns [NaN, ...] when passed NaN" do + Math.lgamma(nan_value)[0].should.nan? end end diff --git a/test/ruby/test_math.rb b/test/ruby/test_math.rb index a676bb5cd9ab84..e134600cc4437c 100644 --- a/test/ruby/test_math.rb +++ b/test/ruby/test_math.rb @@ -321,11 +321,21 @@ def test_lgamma assert_float_and_int([Math.log(6), 1], Math.lgamma(4)) assert_raise_with_message(Math::DomainError, /\blgamma\b/) { Math.lgamma(-Float::INFINITY) } + + x, sign = Math.lgamma(+0.0) + mesg = "Math.lgamma(+0.0) should be [INF, +1]" + assert_infinity(x, mesg) + assert_equal(+1, sign, mesg) + x, sign = Math.lgamma(-0.0) mesg = "Math.lgamma(-0.0) should be [INF, -1]" assert_infinity(x, mesg) assert_equal(-1, sign, mesg) - x, sign = Math.lgamma(Float::NAN) + + x, = Math.lgamma(-1) + assert_infinity(x, "Math.lgamma(-1) should be +INF") + + x, = Math.lgamma(Float::NAN) assert_nan(x) end From 9d44cb0b2b5520b2b299851003ca2a97bf1e2079 Mon Sep 17 00:00:00 2001 From: nagachika Date: Sun, 9 Nov 2025 15:10:35 +0900 Subject: [PATCH 4/6] Remove rbimpl_rstring_getmem() usage as workaround for GCC 15.2.1 optimization bug. [Bug #21655] --- include/ruby/internal/core/rstring.h | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/include/ruby/internal/core/rstring.h b/include/ruby/internal/core/rstring.h index 9cf9daa97c87e7..11377d752be387 100644 --- a/include/ruby/internal/core/rstring.h +++ b/include/ruby/internal/core/rstring.h @@ -415,7 +415,9 @@ RBIMPL_ATTR_ARTIFICIAL() static inline char * RSTRING_PTR(VALUE str) { - char *ptr = rbimpl_rstring_getmem(str).as.heap.ptr; + char *ptr = RB_FL_TEST_RAW(str, RSTRING_NOEMBED) ? + RSTRING(str)->as.heap.ptr : + RSTRING(str)->as.embed.ary; if (RUBY_DEBUG && RB_UNLIKELY(! ptr)) { /* :BEWARE: @shyouhei thinks that currently, there are rooms for this @@ -441,14 +443,17 @@ RBIMPL_ATTR_ARTIFICIAL() static inline char * RSTRING_END(VALUE str) { - struct RString buf = rbimpl_rstring_getmem(str); + char *ptr = RB_FL_TEST_RAW(str, RSTRING_NOEMBED) ? + RSTRING(str)->as.heap.ptr : + RSTRING(str)->as.embed.ary; + long len = RSTRING_LEN(str); - if (RUBY_DEBUG && RB_UNLIKELY(! buf.as.heap.ptr)) { + if (RUBY_DEBUG && RB_UNLIKELY(!ptr)) { /* Ditto. */ rb_debug_rstring_null_ptr("RSTRING_END"); } - return &buf.as.heap.ptr[buf.len]; + return &ptr[len]; } RBIMPL_ATTR_ARTIFICIAL() @@ -480,9 +485,10 @@ RSTRING_LENINT(VALUE str) #ifdef HAVE_STMT_AND_DECL_IN_EXPR # define RSTRING_GETMEM(str, ptrvar, lenvar) \ __extension__ ({ \ - struct RString rbimpl_str = rbimpl_rstring_getmem(str); \ - (ptrvar) = rbimpl_str.as.heap.ptr; \ - (lenvar) = rbimpl_str.len; \ + (ptrvar) = RB_FL_TEST_RAW(str, RSTRING_NOEMBED) ? \ + RSTRING(str)->as.heap.ptr : \ + RSTRING(str)->as.embed.ary; \ + (lenvar) = RSTRING_LEN(str); \ }) #else # define RSTRING_GETMEM(str, ptrvar, lenvar) \ From 367ddd445cdf5ccc55a0481c944746ef595f72f7 Mon Sep 17 00:00:00 2001 From: nagachika Date: Mon, 10 Nov 2025 08:35:09 +0900 Subject: [PATCH 5/6] include/ruby/internal/core/rstring.h: Remove rbimpl_rstring_getmem() definition. --- include/ruby/internal/core/rstring.h | 35 ---------------------------- 1 file changed, 35 deletions(-) diff --git a/include/ruby/internal/core/rstring.h b/include/ruby/internal/core/rstring.h index 11377d752be387..8b965326956192 100644 --- a/include/ruby/internal/core/rstring.h +++ b/include/ruby/internal/core/rstring.h @@ -369,41 +369,6 @@ RSTRING_LEN(VALUE str) return RSTRING(str)->len; } -RBIMPL_WARNING_PUSH() -#if RBIMPL_COMPILER_IS(Intel) -RBIMPL_WARNING_IGNORED(413) -#endif - -RBIMPL_ATTR_PURE_UNLESS_DEBUG() -RBIMPL_ATTR_ARTIFICIAL() -/** - * @private - * - * "Expands" an embedded string into an ordinal one. This is a function that - * returns aggregated type. The returned struct always has its `as.heap.len` - * an `as.heap.ptr` fields set appropriately. - * - * This is an implementation detail that 3rd parties should never bother. - */ -static inline struct RString -rbimpl_rstring_getmem(VALUE str) -{ - RBIMPL_ASSERT_TYPE(str, RUBY_T_STRING); - - if (RB_FL_ANY_RAW(str, RSTRING_NOEMBED)) { - return *RSTRING(str); - } - else { - /* Expecting compilers to optimize this on-stack struct away. */ - struct RString retval = {RBASIC_INIT}; - retval.len = RSTRING_LEN(str); - retval.as.heap.ptr = RSTRING(str)->as.embed.ary; - return retval; - } -} - -RBIMPL_WARNING_POP() - RBIMPL_ATTR_ARTIFICIAL() /** * Queries the contents pointer of the string. From 48dce7874fcb571765635b32fa6a3e3a12e228f8 Mon Sep 17 00:00:00 2001 From: nagachika Date: Mon, 10 Nov 2025 08:37:58 +0900 Subject: [PATCH 6/6] simplify RSRING_GETMEM() definition. --- include/ruby/internal/core/rstring.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/include/ruby/internal/core/rstring.h b/include/ruby/internal/core/rstring.h index 8b965326956192..35175ea94aca81 100644 --- a/include/ruby/internal/core/rstring.h +++ b/include/ruby/internal/core/rstring.h @@ -447,17 +447,7 @@ RSTRING_LENINT(VALUE str) * @param ptrvar Variable where its contents is stored. * @param lenvar Variable where its length is stored. */ -#ifdef HAVE_STMT_AND_DECL_IN_EXPR -# define RSTRING_GETMEM(str, ptrvar, lenvar) \ - __extension__ ({ \ - (ptrvar) = RB_FL_TEST_RAW(str, RSTRING_NOEMBED) ? \ - RSTRING(str)->as.heap.ptr : \ - RSTRING(str)->as.embed.ary; \ - (lenvar) = RSTRING_LEN(str); \ - }) -#else # define RSTRING_GETMEM(str, ptrvar, lenvar) \ ((ptrvar) = RSTRING_PTR(str), \ (lenvar) = RSTRING_LEN(str)) -#endif /* HAVE_STMT_AND_DECL_IN_EXPR */ #endif /* RBIMPL_RSTRING_H */