From a3f47303bb39c631c27883b77d85f6b95073761b Mon Sep 17 00:00:00 2001 From: ydah Date: Thu, 13 Aug 2026 01:47:40 +0900 Subject: [PATCH 1/3] parse.y: fix high nibble in invalid byte escapes --- parse.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse.y b/parse.y index c726402e0fbd3c..7a566681964070 100644 --- a/parse.y +++ b/parse.y @@ -6817,7 +6817,7 @@ rb_parser_str_escape(struct parser_params *p, rb_parser_string_t *str) if (pend < ptr + n) n = (int)(pend - ptr); while (n--) { - c = *ptr & 0xf0 >> 4; + c = ((unsigned char)*ptr >> 4) & 0x0f; charbuf[2] = (c < 10) ? '0' + c : 'A' + c - 10; c = *ptr & 0x0f; charbuf[3] = (c < 10) ? '0' + c : 'A' + c - 10; From 69b49ac7aedc5370512c158d6bbc7f077a85acd7 Mon Sep 17 00:00:00 2001 From: Mrmaxmeier Date: Thu, 27 Aug 2026 01:00:15 +0200 Subject: [PATCH 2/3] hash.c: avoid signed integer overflow in ar_hint_first_match SWAR splat This was previously flagged by ubsan because the AR_HINT_BASE_MASK constant is implicitly typed as long: hash.c:664:43: runtime error: signed integer overflow: 72340172838076673 * 131 cannot be represented in type 'long' Notably, in an unsigned context, this line can't overflow (AR_HINT_BASE_MASK is 0x0101..0101). VALUE is always an unsigned type. --- hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hash.c b/hash.c index 3ca035595d8231..172ed3bd49a502 100644 --- a/hash.c +++ b/hash.c @@ -654,7 +654,7 @@ ar_hint_first_match(ar_hint_t needle, VALUE haystack) { // Common SWAR technique. // First XOR all bytes so that matching ones are set to 0x00. - VALUE search_mask = AR_HINT_BASE_MASK * needle; + VALUE search_mask = (VALUE)AR_HINT_BASE_MASK * needle; VALUE matches = haystack ^ search_mask; // Then turns 0x00 into 0x80, and any other bytes into 0x00. From 7af1270680ddfa42b101ec802167df933f32d2b5 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 28 Aug 2026 19:31:33 +0900 Subject: [PATCH 3/3] [ruby/date] Suppress warnings by clang 21 https://bugs.ruby-lang.org/issues/21629 https://github.com/ruby/date/commit/214024627a --- ext/date/extconf.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ext/date/extconf.rb b/ext/date/extconf.rb index 8a1467df09e402..3ab534f833edfd 100644 --- a/ext/date/extconf.rb +++ b/ext/date/extconf.rb @@ -3,6 +3,9 @@ config_string("strict_warnflags") {|w| $warnflags += " #{w}"} +unless try_compile("", "", werror: true) + append_cflags("-Wno-default-const-init-field-unsafe") +end append_cflags("-Wno-compound-token-split-by-macro") if RUBY_VERSION < "2.7." have_func("rb_category_warn") with_werror("", {:werror => true}) do |opt, |