Skip to content

Commit fcda66f

Browse files
maximecbjeremyevansnobuBurdetteLamarmrkn
authored
Merge commits from ruby/master into yjit_backend_ir (#406)
* Only allow procs created by Symbol#to_proc to call public methods Fixes [Bug #18826] Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> * Revert "Add {Method,UnboundMethod}#{public?,private?,protected?}" This reverts commit 2727815 and 58dc8bf. Visibility is an attribute of the method entry in a class, not an attribute of the Method object. Fixes [#18729] Fixes [#18751] Fixes [#18435] * [ruby/rdoc] Treat text markup (italic, bold, monofont) as blocks (ruby/rdoc#911) ruby/rdoc@dc88f1b425 * Add `--enable-devel` configure option Since `RUBY_DEVEL` in cppflags has no effect in the configure script and makefiles. * Fix paths of exts.mk to clean exts.mk files are one level under the top of extension directories. * The "gems" build directory was rename as ".bundle" * Fix race conditions when cleaning extensions Clean built directories by `make distclean`, and then clean leftover makefiles for skipped extensions. * Fix Array#[] with ArithmeticSequence with negative steps (ruby#5739) * Fix Array#[] with ArithmeticSequence with negative steps Previously, Array#[] when called with an ArithmeticSequence with a negative step did not handle all cases correctly, especially cases involving infinite ranges, inverted ranges, and/or exclusive ends. Fixes [Bug #18247] * Add Array#slice tests for ArithmeticSequence with negative step to test_array Add tests of rb_arithmetic_sequence_beg_len_step C-API function. * Fix ext/-test-/arith_seq/beg_len_step/depend * Rename local variables * Fix a variable name Co-authored-by: Kenta Murata <3959+mrkn@users.noreply.github.com> * [ruby/rdoc] [DOC] Make example formats explicit and consistent (ruby/rdoc#913) ruby/rdoc@7e6ef6c855 * Fix inspect for unicode codepoint 0x85 This is an inelegant hack, by manually checking for this specific code point in rb_str_inspect. Some testing indicates that this is the only code point affected. It's possible a better fix would be inside of lower-level encoding code, such that rb_enc_isprint would return false and not true for codepoint 0x85. Fixes [Bug #16842] * * 2022-08-12 [ci skip] * [ruby/rdoc] Improvements to Text Markup examples (ruby/rdoc#915) ruby/rdoc@d00ddfe57c * [ruby/rdoc] Mods to section Text Markup (ruby/rdoc#916) ruby/rdoc@5506d4d67e * [ruby/error_highlight] Add a note about the current limitation of ErrorHighlight.spot ruby/error_highlight@489ce80a62 * All extensions in bundled gems are built by build-ext now `RbInstall::GemInstaller#build_extensions` has nothing to do. * No bundled gems to be installed from gem now * [DOC] Use `true`/`false` for `@retval`s which are `bool` * Add missing `rb_enc_iscntrl` * Stop defining `RUBY_ABI_VERSION` if released versions As commented in include/ruby/internal/abi.h, since teeny versions of Ruby should guarantee ABI compatibility, `RUBY_ABI_VERSION` has no role in released versions of Ruby. * Add Numeric#ceildiv and Integer#ceildiv * Remove Numeric#ceildiv * Improve performance of Integer#ceildiv This patch is suggested by nobu. Benchmark result: ``` require 'benchmark' n = 10 ** 7 Benchmark.bm do |x| x.report("Fixnum/Fixnum") { a, b = 5, 2; n.times { a.ceildiv(b) } } x.report("Bignum/Bignum") { a, b = 10**100, 10**99 - 1; n.times { a.ceildiv(b) } } x.report("Bignum/Fixnum") { a, b = 10**100, 3; n.times { a.ceildiv(b) } } end ``` Original: ``` user system total real Fixnum/Fixnum 3.340009 0.043029 3.383038 ( 3.384022) Bignum/Bignum 8.229500 0.118543 8.348043 ( 8.349574) Bignum/Fixnum 8.328971 0.097842 8.426813 ( 8.426952) ``` Improved: ``` user system total real Fixnum/Fixnum 0.699140 0.000961 0.700101 ( 0.700199) Bignum/Bignum 5.076165 0.083160 5.159325 ( 5.159360) Bignum/Fixnum 5.548684 0.115372 5.664056 ( 5.666735) ``` * [Bug #18962] Do not read again once reached EOF `Ripper::Lexer#parse` re-parses the source code with syntax errors when `raise_errors: false`. Co-Authored-By: tompng <tomoyapenguin@gmail.com> * Short-circuit `Process._fork` * Introduce with_warn_vsprintf macro * Bundle unreleased debug * Preserve each column positions in gems/bundled_gems * Adjust columns in gems/bundled_gems [ci skip] * [ruby/rdoc] [DOC] Enhances text about escapes (ruby/rdoc#917) ruby/rdoc@c40bac829c * * 2022-08-13 [ci skip] * Add a NEWS entry about Integer#ceildiv [ci skip] * [DOC] Add the link to [Feature #18809] * Silent configure does not output cached configurations * * 2022-08-14 [ci skip] * Update dependencies * [ruby/rinda] Handle situations where IPv4 multicast is not available Fixes [Bug ruby#13864] ruby/rinda@3cd620f38c * * 2022-08-15 [ci skip] * [rubygems/rubygems] Fix Ruby platform incorrectly removed on `bundle update` ruby/rubygems@0d321c9e3a * [ruby/date] [DOC] Enhanced intro for Date (ruby/date#72) ruby/date@59a6673221 * Add test for GC thrashing of young object creation This test will prevent performance regressions like [Bug #18929]. * Simplify around `USE_YJIT` macro (ruby#6240) * Simplify around `USE_YJIT` macro - Use `USE_YJIT` macro only instead of `YJIT_BUILD`. - An intermediate macro `YJIT_SUPPORTED_P` is no longer used. * Bail out if YJIT is enabled on unsupported platforms * * 2022-08-16 [ci skip] * [ruby/rdoc] [DOC] Remove duplicated line in RDoc::MarkupReference ruby/rdoc@488f89aee4 * Allow aarch64 to build YJIT Co-authored-by: Jeremy Evans <code@jeremyevans.net> Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> Co-authored-by: Burdette Lamar <BurdetteLamar@Yahoo.com> Co-authored-by: Kenta Murata <3959+mrkn@users.noreply.github.com> Co-authored-by: git <svn-admin@ruby-lang.org> Co-authored-by: Yusuke Endoh <mame@ruby-lang.org> Co-authored-by: Kouhei Yanagita <yanagi@shakenbu.org> Co-authored-by: tompng <tomoyapenguin@gmail.com> Co-authored-by: S-H-GAMELINKS <gamelinks007@gmail.com> Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net> Co-authored-by: Peter Zhu <peter@peterzhu.ca> Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
1 parent efeb5a8 commit fcda66f

File tree

32 files changed

+505
-373
lines changed

32 files changed

+505
-373
lines changed

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ Note: We're only listing outstanding class updates.
104104
empty, instead of returning the default value or
105105
calling the default proc. [[Bug #16908]]
106106
107+
* Integer
108+
* Integer#ceildiv has been added. [[Feature #18809]]
109+
107110
* Kernel
108111
* Kernel#binding raises RuntimeError if called from a non-Ruby frame
109112
(such as a method defined in C). [[Bug #18487]]
@@ -276,3 +279,4 @@ The following deprecated APIs are removed.
276279
[Feature #18685]: https://bugs.ruby-lang.org/issues/18685
277280
[Bug #18782]: https://bugs.ruby-lang.org/issues/18782
278281
[Feature #18788]: https://bugs.ruby-lang.org/issues/18788
282+
[Feature #18809]: https://bugs.ruby-lang.org/issues/18809

common.mk

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13822,7 +13822,6 @@ signal.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
1382213822
signal.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
1382313823
signal.$(OBJEXT): $(CCAN_DIR)/list/list.h
1382413824
signal.$(OBJEXT): $(CCAN_DIR)/str/str.h
13825-
signal.$(OBJEXT): $(hdrdir)/ruby.h
1382613825
signal.$(OBJEXT): $(hdrdir)/ruby/ruby.h
1382713826
signal.$(OBJEXT): $(top_srcdir)/internal/array.h
1382813827
signal.$(OBJEXT): $(top_srcdir)/internal/compilers.h
@@ -14008,7 +14007,6 @@ signal.$(OBJEXT): {$(VPATH)}internal/warning_push.h
1400814007
signal.$(OBJEXT): {$(VPATH)}internal/xmalloc.h
1400914008
signal.$(OBJEXT): {$(VPATH)}method.h
1401014009
signal.$(OBJEXT): {$(VPATH)}missing.h
14011-
signal.$(OBJEXT): {$(VPATH)}mjit.h
1401214010
signal.$(OBJEXT): {$(VPATH)}node.h
1401314011
signal.$(OBJEXT): {$(VPATH)}onigmo.h
1401414012
signal.$(OBJEXT): {$(VPATH)}oniguruma.h
@@ -14024,7 +14022,6 @@ signal.$(OBJEXT): {$(VPATH)}thread_native.h
1402414022
signal.$(OBJEXT): {$(VPATH)}vm_core.h
1402514023
signal.$(OBJEXT): {$(VPATH)}vm_debug.h
1402614024
signal.$(OBJEXT): {$(VPATH)}vm_opts.h
14027-
signal.$(OBJEXT): {$(VPATH)}yjit.h
1402814025
sprintf.$(OBJEXT): $(hdrdir)/ruby/ruby.h
1402914026
sprintf.$(OBJEXT): $(top_srcdir)/internal/bignum.h
1403014027
sprintf.$(OBJEXT): $(top_srcdir)/internal/bits.h
@@ -17593,16 +17590,14 @@ yjit.$(OBJEXT): $(top_srcdir)/internal/array.h
1759317590
yjit.$(OBJEXT): $(top_srcdir)/internal/class.h
1759417591
yjit.$(OBJEXT): $(top_srcdir)/internal/compile.h
1759517592
yjit.$(OBJEXT): $(top_srcdir)/internal/compilers.h
17593+
yjit.$(OBJEXT): $(top_srcdir)/internal/fixnum.h
1759617594
yjit.$(OBJEXT): $(top_srcdir)/internal/gc.h
1759717595
yjit.$(OBJEXT): $(top_srcdir)/internal/hash.h
1759817596
yjit.$(OBJEXT): $(top_srcdir)/internal/imemo.h
17599-
yjit.$(OBJEXT): $(top_srcdir)/internal/object.h
17600-
yjit.$(OBJEXT): $(top_srcdir)/internal/re.h
1760117597
yjit.$(OBJEXT): $(top_srcdir)/internal/sanitizers.h
1760217598
yjit.$(OBJEXT): $(top_srcdir)/internal/serial.h
1760317599
yjit.$(OBJEXT): $(top_srcdir)/internal/static_assert.h
1760417600
yjit.$(OBJEXT): $(top_srcdir)/internal/string.h
17605-
yjit.$(OBJEXT): $(top_srcdir)/internal/struct.h
1760617601
yjit.$(OBJEXT): $(top_srcdir)/internal/variable.h
1760717602
yjit.$(OBJEXT): $(top_srcdir)/internal/vm.h
1760817603
yjit.$(OBJEXT): $(top_srcdir)/internal/warnings.h
@@ -17620,6 +17615,7 @@ yjit.$(OBJEXT): {$(VPATH)}backward/2/stdarg.h
1762017615
yjit.$(OBJEXT): {$(VPATH)}builtin.h
1762117616
yjit.$(OBJEXT): {$(VPATH)}config.h
1762217617
yjit.$(OBJEXT): {$(VPATH)}constant.h
17618+
yjit.$(OBJEXT): {$(VPATH)}debug.h
1762317619
yjit.$(OBJEXT): {$(VPATH)}debug_counter.h
1762417620
yjit.$(OBJEXT): {$(VPATH)}defines.h
1762517621
yjit.$(OBJEXT): {$(VPATH)}encoding.h
@@ -17798,6 +17794,7 @@ yjit.$(OBJEXT): {$(VPATH)}thread_native.h
1779817794
yjit.$(OBJEXT): {$(VPATH)}vm_callinfo.h
1779917795
yjit.$(OBJEXT): {$(VPATH)}vm_core.h
1780017796
yjit.$(OBJEXT): {$(VPATH)}vm_debug.h
17797+
yjit.$(OBJEXT): {$(VPATH)}vm_insnhelper.h
1780117798
yjit.$(OBJEXT): {$(VPATH)}vm_opts.h
1780217799
yjit.$(OBJEXT): {$(VPATH)}vm_sync.h
1780317800
yjit.$(OBJEXT): {$(VPATH)}yjit.c

configure.ac

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ AC_SUBST(GIT)
8888
AC_SUBST(HAVE_GIT)
8989

9090
eval `sed -n -e ['s/^@%:@define RUBY_[A-Z_]*VERSION_\([A-Z][A-Z][A-Z_0-9]*\) \([0-9][0-9]*\)$/\1=\2/p'] \
91+
-e ['s/^@%:@define \(RUBY_ABI_VERSION\) \([0-9][0-9]*\).*/\1=\2/p'] \
9192
-e ['s/^@%:@define \(RUBY_PATCHLEVEL\) \(.*\)/\1=\2/p'] \
93+
$srcdir/include/ruby/internal/abi.h \
9294
$srcdir/include/ruby/version.h $srcdir/version.h`
9395
for v in MAJOR MINOR TEENY; do
9496
AS_IF([eval "test \"\$$v\" = ''"], [
@@ -100,6 +102,9 @@ AC_SUBST(MINOR)
100102
AC_SUBST(TEENY)
101103
AC_SUBST(RUBY_API_VERSION, '$(MAJOR).$(MINOR)')
102104
AC_SUBST(RUBY_PROGRAM_VERSION, '$(MAJOR).$(MINOR).$(TEENY)')
105+
AS_CASE([$RUBY_PATCHLEVEL], [-*], [
106+
AC_DEFINE_UNQUOTED(RUBY_ABI_VERSION, [${RUBY_ABI_VERSION}])
107+
], [RUBY_ABI_VERSION=])
103108

104109
AS_IF([test "$program_prefix" = NONE], [
105110
program_prefix=
@@ -4118,6 +4123,7 @@ AS_CASE(["$ruby_version"],
41184123
AS_IF([test ${RUBY_LIB_VERSION_STYLE+set}], [
41194124
{
41204125
echo "#define RUBY_LIB_VERSION_STYLE $RUBY_LIB_VERSION_STYLE"
4126+
echo '@%:@include "confdefs.h"'
41214127
echo '#define STRINGIZE(x) x'
41224128
test -f revision.h -o -f "${srcdir}/revision.h" || echo '#define RUBY_REVISION 0'
41234129
echo '#include "version.h"'

doc/rdoc/markup_reference.rb

Lines changed: 103 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
# - {Directive}[rdoc-ref:RDoc::MarkupReference@Directives]:
9595
# various special directions for the rendering.
9696
# - {Text Markup}[rdoc-ref:RDoc:MarkupReference@Text+Markup]:
97-
# text to be rendered in italic, bold, or monofont.
97+
# text to be rendered in a special way.
9898
#
9999
# About the blocks:
100100
#
@@ -632,18 +632,24 @@
632632
#
633633
# ==== Text Markup
634634
#
635-
# Text markup is metatext that marks text as:
635+
# Text markup is metatext that affects HTML rendering:
636636
#
637-
# - Italic.
638-
# - Bold.
639-
# - Monofont.
637+
# - Typeface: italic, bold, monofont.
638+
# - Character conversions: copyright, trademark, certain punctuation.
639+
# - Links.
640+
# - Escapes: marking text as "not markup."
640641
#
641-
# Text markup may contain only one type of nested block:
642+
# ===== Typeface Markup
642643
#
643-
# - More text markup:
644+
# Typeface markup can specify that text is to be rendered
645+
# as italic, bold, or monofont.
646+
#
647+
# Typeface markup may contain only one type of nested block:
648+
#
649+
# - More typeface markup:
644650
# italic, bold, monofont.
645651
#
646-
# ===== Italic
652+
# ====== Italic
647653
#
648654
# Text may be marked as italic via HTML tag <tt><i></tt> or <tt><em></tt>.
649655
#
@@ -698,7 +704,7 @@
698704
#
699705
# ====== _Italic_ in a Heading
700706
#
701-
# ===== Bold
707+
# ====== Bold
702708
#
703709
# Text may be marked as bold via HTML tag <tt><b></tt>.
704710
#
@@ -755,7 +761,7 @@
755761
#
756762
# ===== *Bold* in a Heading
757763
#
758-
# ===== Monofont
764+
# ====== Monofont
759765
#
760766
# Text may be marked as monofont
761767
# -- sometimes called 'typewriter font' --
@@ -814,37 +820,6 @@
814820
#
815821
# ====== +Monofont+ in a Heading
816822
#
817-
# ==== Escaping Text Markup
818-
#
819-
# Text markup can be escaped with a backslash, as in \<tt>, which was obtained
820-
# with <tt>\\<tt></tt>. Except in verbatim sections and between \<tt> tags,
821-
# to produce a backslash you have to double it unless it is followed by a
822-
# space, tab or newline. Otherwise, the HTML formatter will discard it, as it
823-
# is used to escape potential links:
824-
#
825-
# * The \ must be doubled if not followed by white space: \\.
826-
# * But not in \<tt> tags: in a Regexp, <tt>\S</tt> matches non-space.
827-
# * This is a link to {ruby-lang}[https://www.ruby-lang.org].
828-
# * This is not a link, however: \{ruby-lang.org}[https://www.ruby-lang.org].
829-
# * This will not be linked to \RDoc::RDoc#document
830-
#
831-
# generates:
832-
#
833-
# * The \ must be doubled if not followed by white space: \\.
834-
# * But not in \<tt> tags: in a Regexp, <tt>\S</tt> matches non-space.
835-
# * This is a link to {ruby-lang}[https://www.ruby-lang.org]
836-
# * This is not a link, however: \{ruby-lang.org}[https://www.ruby-lang.org]
837-
# * This will not be linked to \RDoc::RDoc#document
838-
#
839-
# Inside \<tt> tags, more precisely, leading backslashes are removed only if
840-
# followed by a markup character (<tt><*_+</tt>), a backslash, or a known link
841-
# reference (a known class or method). So in the example above, the backslash
842-
# of <tt>\S</tt> would be removed if there was a class or module named +S+ in
843-
# the current context.
844-
#
845-
# This behavior is inherited from RDoc version 1, and has been kept for
846-
# compatibility with existing RDoc documentation.
847-
#
848823
# ==== Character Conversions
849824
#
850825
# Certain combinations of characters may be converted to special characters;
@@ -891,7 +866,6 @@
891866
#
892867
# - On-page: <tt>::dummy_singleton_method</tt> links to ::dummy_singleton_method.
893868
# - Off-page<tt>RDoc::TokenStream::to_html</tt> links to RDoc::TokenStream::to_html.
894-
# to \RDoc::TokenStream::to_html.
895869
#
896870
# Note: Occasionally \RDoc is not linked to a method whose name
897871
# has only special characters. Check whether the links you were expecting
@@ -1068,6 +1042,93 @@
10681042
#
10691043
# {rdoc-image:https://www.ruby-lang.org/images/header-ruby-logo@2x.png}[./Alias.html]
10701044
#
1045+
# === Escaping Text
1046+
#
1047+
# Text that would otherwise be interpreted as markup
1048+
# can be "escaped," so that it is not interpreted as markup;
1049+
# the escape character is the backslash (<tt>'\\'</tt>).
1050+
#
1051+
# In a verbatim text block or a code block,
1052+
# the escape character is always preserved:
1053+
#
1054+
# Example input:
1055+
#
1056+
# This is not verbatim text.
1057+
#
1058+
# This is verbatim text, with an escape character \.
1059+
#
1060+
# This is not a code block.
1061+
#
1062+
# def foo
1063+
# 'String with an escape character.'
1064+
# end
1065+
#
1066+
# Rendered HTML:
1067+
#
1068+
# >>>
1069+
# This is not verbatim text.
1070+
#
1071+
# This is verbatim text, with an escape character \.
1072+
#
1073+
# This is not a code block.
1074+
#
1075+
# def foo
1076+
# 'This is a code block with an escape character \.'
1077+
# end
1078+
#
1079+
# In typeface markup (italic, bold, or monofont),
1080+
# an escape character is preserved unless it is immediately
1081+
# followed by nested typeface markup.
1082+
#
1083+
# Example input:
1084+
#
1085+
# This list is about escapes; it contains:
1086+
#
1087+
# - <tt>Monofont text with unescaped nested _italic_</tt>.
1088+
# - <tt>Monofont text with escaped nested \_italic_</tt>.
1089+
# - <tt>Monofont text with an escape character \</tt>.
1090+
#
1091+
# Rendered HTML:
1092+
#
1093+
# >>>
1094+
# This list is about escapes; it contains:
1095+
#
1096+
# - <tt>Monofont text with unescaped nested _italic_</tt>.
1097+
# - <tt>Monofont text with escaped nested \_italic_</tt>.
1098+
# - <tt>Monofont text with an escape character \ </tt>.
1099+
#
1100+
# In other text-bearing blocks
1101+
# (paragraphs, block quotes, list items, headings):
1102+
#
1103+
# - A single escape character immediately followed by markup
1104+
# escapes the markup.
1105+
# - A single escape character followed by whitespace is preserved.
1106+
# - A single escape character anywhere else is ignored.
1107+
# - A double escape character is rendered as a single backslash.
1108+
#
1109+
# Example input:
1110+
#
1111+
# This list is about escapes; it contains:
1112+
#
1113+
# - An unescaped class name, RDoc, that will become a link.
1114+
# - An escaped class name, \RDoc, that will not become a link.
1115+
# - An escape character followed by whitespace \ .
1116+
# - An escape character \that is ignored.
1117+
# - A double escape character \\ that is rendered
1118+
# as a single backslash.
1119+
#
1120+
# Rendered HTML:
1121+
#
1122+
# >>>
1123+
# This list is about escapes; it contains:
1124+
#
1125+
# - An unescaped class name, RDoc, that will become a link.
1126+
# - An escaped class name, \RDoc, that will not become a link.
1127+
# - An escape character followed by whitespace \ .
1128+
# - An escape character \that is ignored.
1129+
# - A double escape character \\ that is rendered
1130+
# as a single backslash.
1131+
#
10711132
# == Documentation Derived from Ruby Code
10721133
#
10731134
# [Class]

error.c

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -357,47 +357,42 @@ warn_vsprintf(rb_encoding *enc, const char *file, int line, const char *fmt, va_
357357
return rb_str_cat2(str, "\n");
358358
}
359359

360+
#define with_warn_vsprintf(file, line, fmt) \
361+
VALUE str; \
362+
va_list args; \
363+
va_start(args, fmt); \
364+
str = warn_vsprintf(NULL, file, line, fmt, args); \
365+
va_end(args);
366+
360367
void
361368
rb_compile_warn(const char *file, int line, const char *fmt, ...)
362369
{
363-
VALUE str;
364-
va_list args;
365-
366-
if (NIL_P(ruby_verbose)) return;
367-
368-
va_start(args, fmt);
369-
str = warn_vsprintf(NULL, file, line, fmt, args);
370-
va_end(args);
371-
rb_write_warning_str(str);
370+
if (!NIL_P(ruby_verbose)) {
371+
with_warn_vsprintf(file, line, fmt) {
372+
rb_write_warning_str(str);
373+
}
374+
}
372375
}
373376

374377
/* rb_compile_warning() reports only in verbose mode */
375378
void
376379
rb_compile_warning(const char *file, int line, const char *fmt, ...)
377380
{
378-
VALUE str;
379-
va_list args;
380-
381-
if (!RTEST(ruby_verbose)) return;
382-
383-
va_start(args, fmt);
384-
str = warn_vsprintf(NULL, file, line, fmt, args);
385-
va_end(args);
386-
rb_write_warning_str(str);
381+
if (RTEST(ruby_verbose)) {
382+
with_warn_vsprintf(file, line, fmt) {
383+
rb_write_warning_str(str);
384+
}
385+
}
387386
}
388387

389388
void
390389
rb_category_compile_warn(rb_warning_category_t category, const char *file, int line, const char *fmt, ...)
391390
{
392-
VALUE str;
393-
va_list args;
394-
395-
if (NIL_P(ruby_verbose)) return;
396-
397-
va_start(args, fmt);
398-
str = warn_vsprintf(NULL, file, line, fmt, args);
399-
va_end(args);
400-
rb_warn_category(str, rb_warning_category_to_name(category));
391+
if (!NIL_P(ruby_verbose)) {
392+
with_warn_vsprintf(file, line, fmt) {
393+
rb_warn_category(str, rb_warning_category_to_name(category));
394+
}
395+
}
401396
}
402397

403398
RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 2, 0)

ext/-test-/abi/extconf.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# frozen_string_literal: false
2+
return unless RUBY_PATCHLEVEL < 0
23
require_relative "../auto_ext.rb"
34
auto_ext(inc: true)

0 commit comments

Comments
 (0)