Commit graph

75689 commits

Author SHA1 Message Date
nagachika
128d8728d3 merge revision(s) ef59175a68: [Backport #19903]
fix iseq kwargs table and original_iseq leaks

	[bug #19903]

	Co-authored-by: Peter Zhu <peter@peterzhu.ca>
	---
	 iseq.c | 4 ++++
	 1 file changed, 4 insertions(+)
2023-09-30 13:48:45 +09:00
nagachika
a191cf5617 merge revision(s) c42261059d: [Backport #19901]
[Bug #19901]

	fix leak in module clone

	Co-authored-by: Peter Zhu <peter@peterzhu.ca>
	---
	 class.c                  |  1 +
	 test/ruby/test_module.rb | 12 ++++++++++++
	 2 files changed, 13 insertions(+)
2023-09-30 13:47:33 +09:00
nagachika
97b7070ebd merge revision(s) 8b236e0c66: [Backport #19896]
[Bug #19896]

	fix memory leak in vm_method

	This introduces a unified reference_count to clarify who is referencing a method.
	This also allows us to treat the refinement method as the def owner since it counts itself as a reference

	Co-authored-by: Peter Zhu <peter@peterzhu.ca>
	---
	 gc.c                     |   4 +-
	 method.h                 |   6 +--
	 rjit_c.rb                |   6 +--
	 test/ruby/test_module.rb |   4 +-
	 vm_insnhelper.c          |   2 +-
	 vm_method.c              | 105 +++++++++++++++++++----------------------------
	 6 files changed, 54 insertions(+), 73 deletions(-)
2023-09-30 13:46:29 +09:00
nagachika
5640baa2f8 merge revision(s) fe0225ff4d: [Backport #19778]
[Bug #19778] Add `-I` options for opt-dir to `$INCFLAGS`

	These options have been separated from `$CFLAGS` already in the
	other places.
	---
	 configure.ac | 2 +-
	 1 file changed, 1 insertion(+), 1 deletion(-)
2023-09-30 13:37:37 +09:00
nagachika
e7ab923b88 merge revision(s) d4c720a91b: [Backport #19845]
Fix support for dynamic keys. (#8273)

	* Skip RBS test.
	---
	 cont.c                               |  8 +++-----
	 spec/ruby/core/fiber/storage_spec.rb | 14 ++++++++++++++
	 tool/rbs_skip_tests                  |  2 ++
	 3 files changed, 19 insertions(+), 5 deletions(-)
2023-09-30 13:30:08 +09:00
nagachika
d30781db4d merge revision(s) 2214bcb70d: [Backport #19792]
Fix premature string collection during append

	Previously, the following crashed due to use-after-free
	with AArch64 Alpine Linux 3.18.3 (aarch64-linux-musl):

	```ruby
	str = 'a' * (32*1024*1024)
	p({z: str})
	```

	32 MiB is the default for `GC_MALLOC_LIMIT_MAX`, and the crash
	could be dodged by setting `RUBY_GC_MALLOC_LIMIT_MAX` to large values.
	Under a debugger, one can see the `str2` of rb_str_buf_append()
	getting prematurely collected while str_buf_cat4() allocates capacity.

	Add GC guards so the buffer of `str2` lives across the GC run
	initiated in str_buf_cat4().

	[Bug #19792]
	---
	 string.c | 2 ++
	 1 file changed, 2 insertions(+)
2023-09-30 13:07:35 +09:00
nagachika
9ee58b2054 merge revision(s) 96c5a4be7b: [Backport #19894]
Fix memory leak in complemented method entries

	[Bug #19894]

	When a copy of a complemented method entry is created, there are two
	issues:

	1. IMEMO_FL_USER3 is not copied, so the complemented status is not
	   copied over.
	2. In rb_method_entry_clone we increment both alias_count and
	   complemented_count. However, when we free the method entry in
	   rb_method_definition_release, we only decrement one of the two
	   counters, resulting in the rb_method_definition_t being leaked.

	Co-authored-by: Adam Hess <adamhess1991@gmail.com>
	---
	 method.h                 |  5 +++--
	 test/ruby/test_module.rb | 29 +++++++++++++++++++++++++++++
	 vm_method.c              |  8 +++++---
	 3 files changed, 37 insertions(+), 5 deletions(-)
2023-09-24 15:13:32 +09:00
nagachika
9cd28caa7c merge revision(s) 901b6d9c50: [Backport #19853]
Validate the typed data before dereferencing the internal struct.
	 (#8315)

	---
	 process.c                  |  5 +++--
	 test/fiber/test_process.rb | 21 +++++++++++++++++++++
	 2 files changed, 24 insertions(+), 2 deletions(-)
2023-09-24 14:16:10 +09:00
nagachika
217ef2bf89 merge revision(s) 25711683e8: [Backport #19864]
Fix regression when testing inclusion in unbounded ranges

	Caused by 04a92a6764.  This treats
	unbounded ranges of arbitrary objects the same as how unbounded
	string ranges are treated:

	  (..x)  === y  # (y <=> x) <= 0
	  (...x) === y  # (y <=> x) <  0
	  (x..)  === y  # (x <=> y) <= 0

	Fixes [Bug #19864]
	---
	 range.c                 |  9 +++++++++
	 test/ruby/test_range.rb | 23 +++++++++++++++++++++++
	 2 files changed, 32 insertions(+)
2023-09-24 13:48:08 +09:00
Peter Zhu
a7335e11e3
[Backport 3.2] Fix missing write barrier in iseq instruction list (#8431)
Fix missing write barrier in iseq instruction list

[Bug #19880]

There's a missing write barrier for operands in the iseq instruction
list, which can cause crashes.

It can be reproduced when Ruby is compiled with `-DRUBY_DEBUG_ENV=1`.
Using the following command:

```
RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=0 RUBY_DEBUG=gc_stress ruby -w --disable=gems -Itool/lib -W0 test.rb
```

The following script crashes:

```
require "test/unit"
```
2023-09-16 05:17:20 +00:00
Alan Wu
e159971e03
[For ruby_3_2] Fix unused_mut Rust warnings (#8435)
Fix unused_mut Rust warnings

Rust version 1.71.0 and up issue these warnings. On GitHub CI, the
warnings were previously seen in -DYJIT_FORCE_ENABLE runs.
2023-09-16 04:06:39 +00:00
nagachika
bb877e5b4f merge revision(s) 382678d411: [Backport #19788]
[Bug #19788] Use the result of `tCOLON2` event

	---
	 parse.y                            | 16 ++++++++--------
	 test/ripper/test_parser_events.rb  | 17 +++++++++++++++++
	 test/ripper/test_scanner_events.rb |  5 +++++
	 3 files changed, 30 insertions(+), 8 deletions(-)
2023-09-09 19:33:29 +09:00
KJ Tsanaktsidis
0b7a4fbaa9 Allow waitpid(-1) to be woken if a waitpid(pid) call is pending
If two threads are running, with one calling waitpid(-1), and another
calling waitpid($some_pid), and then $some_other_pid exits, we would
expect the waitpid(-1) call to retrieve that exit status; however, it
cannot actually do so until $some_pid _also_ exits.

This patch fixes the issue by unconditionally checking for pending
process group waits on SIGCHLD, and then allowing pending pid-only waits
to "steal" the notification.

[Fixes #19387]
2023-09-09 18:51:25 +09:00
Hiroshi SHIBATA
bbdffef63c Bump up bundler-2.4.19 2023-08-29 23:25:18 +09:00
Hiroshi SHIBATA
ab1eacc8bc Merge RubyGems-3.4.19 and Bundler-2.4.19 2023-08-29 23:25:18 +09:00
Hiroshi SHIBATA
1434059ab5 Merge RubyGems-3.4.18 and Bundler-2.4.18 2023-08-29 23:25:18 +09:00
Hiroshi SHIBATA
d6c3a1778c Merge RubyGems-3.4.17 and Bundler-2.4.17 2023-08-29 23:25:18 +09:00
Hiroshi SHIBATA
829048df2f Merge RubyGems-3.4.16 and Bundler-2.4.16 2023-08-29 23:25:18 +09:00
Hiroshi SHIBATA
e44e42c303 Merge RubyGems-3.4.15 and Bundler-2.4.15 2023-08-29 23:25:18 +09:00
Hiroshi SHIBATA
a36c836433 Merge RubyGems-3.4.14 and Bundler-2.4.14 2023-08-29 23:25:18 +09:00
Hiroshi SHIBATA
1b1a5b2984 Merge RubyGems-3.4.13 and Bundler-2.4.13 2023-08-29 23:25:18 +09:00
Hiroshi SHIBATA
c71a89f785 Merge RubyGems-3.4.12 and Bundler-2.4.12 2023-08-29 23:25:18 +09:00
Hiroshi SHIBATA
dd91a17560 Merge RubyGems-3.4.11 and Bundler-2.4.11 2023-08-29 23:25:18 +09:00
nagachika
5d568e1898 merge revision(s) a28c5151f5: [Backport #19855]
Fix Array#bsearch when block returns a non-integer numeric value

	---
	 array.c                 | 4 ++--
	 test/ruby/test_array.rb | 4 ++++
	 2 files changed, 6 insertions(+), 2 deletions(-)
2023-08-29 21:06:04 +09:00
nagachika
e777064e4b Revert "Re-apply "Ruby 3.2 - Speed up rebuilding the loaded feature index and realpath cache (#8023)" (#8252)"
This reverts commit 788b03d5ba.
2023-08-24 16:06:32 +09:00
MSP-Greg
788b03d5ba
Re-apply "Ruby 3.2 - Speed up rebuilding the loaded feature index and realpath cache (#8023)" (#8252)
* Re-apply "Ruby 3.2 - Speed up rebuilding the loaded feature index and realpath cache (#8023)"

* [CI] mingw.yml - remove IBM437 encoding for test-all, use cmd shell for test & test-all

* Skip failing test on mingw with readline.so

Co-authored-by: nagachika <nagachika@ruby-lang.org>

---------

Co-authored-by: nagachika <nagachika@ruby-lang.org>
2023-08-21 23:33:47 +00:00
Hiroshi SHIBATA
e517ba2e5b Bump up syntax_suggest-1.1.0 2023-08-20 13:26:54 +09:00
nagachika
0c908fa681 merge revision(s) 0b8f15575a: [Backport #19836]
Fix memory leak for incomplete lambdas

	[Bug #19836]

	The parser does not free the chain of `struct vtable`, which causes
	memory leaks.

	The following script reproduces this issue:

	```
	10.times do
	  100_000.times do
	    Ripper.parse("-> {")
	  end

	  puts `ps -o rss= -p #{$$}`
	end
	```
	---
	 parse.y                    | 24 ++++++++++++++----------
	 test/ripper/test_ripper.rb |  7 +++++++
	 2 files changed, 21 insertions(+), 10 deletions(-)
2023-08-13 13:35:25 +09:00
nagachika
6898389a0f merge revision(s) 5bc8fceca8: [Backport #19835]
Fix memory leak in parser for incomplete tokens

	[Bug #19835]

	The parser does not free the `tbl` of the `struct vtable` when there are
	leftover `lvtbl` in the parser. This causes a memory leak.

	The following script reproduces this issue:

	```
	10.times do
	  100_000.times do
	    Ripper.parse("class Foo")
	  end

	  puts `ps -o rss= -p #{$$}`
	end
	```
	---
	 parse.y                    | 42 ++++++++++++++++++++++++++++--------------
	 test/ripper/test_ripper.rb |  7 +++++++
	 2 files changed, 35 insertions(+), 14 deletions(-)
2023-08-13 13:21:30 +09:00
nagachika
ead1a83b2f merge revision(s) 1b0da1e623:
Skip running brew upgrade (#8189)

	This has been unstable:
	1571398859

	and I'm not sure if we need that in the first place, assuming the
	OS image itself is maintained by GitHub.
	---
	 .github/actions/setup/macos/action.yml | 1 -
	 1 file changed, 1 deletion(-)
2023-08-12 13:54:17 +09:00
nagachika
b11f238a81 merge revision(s) 72d1a790cf: [Backport #19833]
[Bug #19833] Fix index underflow at superclasses of `BasicObject`

	---
	 object.c                | 4 ++++
	 test/ruby/test_class.rb | 7 +++++++
	 2 files changed, 11 insertions(+)
2023-08-12 13:51:03 +09:00
nagachika
3c9cb70311 merge revision(s) 1d096c1e53: [Backport #19793]
Fix crash in NoMethodError for dummy frames
	MIME-Version: 1.0
	Content-Type: text/plain; charset=UTF-8
	Content-Transfer-Encoding: 8bit

	[Bug #19793]

	Dummy frames are created at the top level when requiring another file.
	While requiring a file, it will try to convert using encodings. Some of
	these encodings will not respond to to_str. If method_missing is
	redefined on Object, then it will call method_missing and attempt raise
	an error. However, the iseq is invalid as it's a dummy frame so it will
	write an invalid iseq to the created NoMethodError.

	The following script crashes:

	```
	GC.stress = true

	class Object
	  public :method_missing
	end

	File.write("/tmp/empty.rb", "")
	require "/tmp/empty.rb"
	```

	With the following backtrace:

	```
	frame #0: 0x00000001000fa8b8 miniruby`RVALUE_MARKED(obj=4308637824) at gc.c:1638:12
	frame #1: 0x00000001000fb440 miniruby`RVALUE_BLACK_P(obj=4308637824) at gc.c:1763:12
	frame #2: 0x00000001000facdc miniruby`gc_writebarrier_incremental(a=4308637824, b=4308332208, objspace=0x000000010180b000) at gc.c:8822:9
	frame #3: 0x00000001000faad8 miniruby`rb_gc_writebarrier(a=4308637824, b=4308332208) at gc.c:8864:17
	frame #4: 0x000000010016aff0 miniruby`rb_obj_written(a=4308637824, oldv=36, b=4308332208, filename="../iseq.c", line=1279) at gc.h:804:9
	frame #5: 0x0000000100162a60 miniruby`rb_obj_write(a=4308637824, slot=0x0000000100d09888, b=4308332208, filename="../iseq.c", line=1279) at gc.h:837:5
	frame #6: 0x0000000100165b0c miniruby`iseqw_new(iseq=0x0000000100d09880) at iseq.c:1279:9
	frame #7: 0x0000000100165a64 miniruby`rb_iseqw_new(iseq=0x0000000100d09880) at iseq.c:1289:12
	frame #8: 0x00000001000d8324 miniruby`name_err_init_attr(exc=4309777920, recv=4304780496, method=827660) at error.c:1830:35
	frame #9: 0x00000001000d1b80 miniruby`name_err_init(exc=4309777920, mesg=4308332496, recv=4304780496, method=827660) at error.c:1869:12
	frame #10: 0x00000001000d1bd4 miniruby`rb_nomethod_err_new(mesg=4308332496, recv=4304780496, method=827660, args=4308332448, priv=0) at error.c:1957:5
	frame #11: 0x000000010039049c miniruby`rb_make_no_method_exception(exc=4304914512, format=4308332496, obj=4304780496, argc=1, argv=0x000000016fdfab00, priv=0) at vm_eval.c:959:16
	frame #12: 0x00000001003b3274 miniruby`raise_method_missing(ec=0x0000000100b06f40, argc=1, argv=0x000000016fdfab00, obj=4304780496, last_call_status=MISSING_NOENTRY) at vm_eval.c:999:15
	frame #13: 0x00000001003945d4 miniruby`rb_method_missing(argc=1, argv=0x000000016fdfab00, obj=4304780496) at vm_eval.c:944:5
	...
	frame #23: 0x000000010038f5e4 miniruby`rb_vm_call_kw(ec=0x0000000100b06f40, recv=4304780496, id=2865, argc=1, argv=0x000000016fdfab00, me=0x0000000100cbfcf0, kw_splat=0) at vm_eval.c:326:12
	frame #24: 0x00000001003c18e4 miniruby`call_method_entry(ec=0x0000000100b06f40, defined_class=4304927952, obj=4304780496, id=2865, cme=0x0000000100cbfcf0, argc=1, argv=0x000000016fdfab00, kw_splat=0) at vm_method.c:2720:20
	frame #25: 0x00000001003c440c miniruby`check_funcall_exec(v=6171896792) at vm_eval.c:589:12
	frame #26: 0x00000001000dec00 miniruby`rb_vrescue2(b_proc=(miniruby`check_funcall_exec at vm_eval.c:587), data1=6171896792, r_proc=(miniruby`check_funcall_failed at vm_eval.c:596), data2=6171896792, args="Pȗ") at eval.c:919:18
	frame #27: 0x00000001000deab0 miniruby`rb_rescue2(b_proc=(miniruby`check_funcall_exec at vm_eval.c:587), data1=6171896792, r_proc=(miniruby`check_funcall_failed at vm_eval.c:596), data2=6171896792) at eval.c:900:17
	frame #28: 0x000000010039008c miniruby`check_funcall_missing(ec=0x0000000100b06f40, klass=4304923536, recv=4304780496, mid=3233, argc=0, argv=0x0000000000000000, respond=-1, def=36, kw_splat=0) at vm_eval.c:666:15
	frame #29: 0x000000010038fa60 miniruby`rb_check_funcall_default_kw(recv=4304780496, mid=3233, argc=0, argv=0x0000000000000000, def=36, kw_splat=0) at vm_eval.c:703:21
	frame #30: 0x000000010038fb04 miniruby`rb_check_funcall(recv=4304780496, mid=3233, argc=0, argv=0x0000000000000000) at vm_eval.c:685:12
	frame #31: 0x00000001001c469c miniruby`convert_type_with_id(val=4304780496, tname="String", method=3233, raise=0, index=-1) at object.c:3061:15
	frame #32: 0x00000001001c4a4c miniruby`rb_check_convert_type_with_id(val=4304780496, type=5, tname="String", method=3233) at object.c:3153:9
	frame #33: 0x00000001002d59f8 miniruby`rb_check_string_type(str=4304780496) at string.c:2571:11
	frame #34: 0x000000010014b7b0 miniruby`io_encoding_set(fptr=0x0000000100d09ca0, v1=4304780496, v2=4, opt=4) at io.c:11655:19
	frame #35: 0x0000000100139a58 miniruby`rb_io_set_encoding(argc=1, argv=0x000000016fdfb450, io=4308334032) at io.c:13497:5
	frame #36: 0x00000001003c0004 miniruby`ractor_safe_call_cfunc_m1(recv=4308334032, argc=1, argv=0x000000016fdfb450, func=(miniruby`rb_io_set_encoding at io.c:13487)) at vm_insnhelper.c:3271:12
	...
	frame #43: 0x0000000100390b08 miniruby`rb_funcall(recv=4308334032, mid=16593, n=1) at vm_eval.c:1137:12
	frame #44: 0x00000001002a43d8 miniruby`load_file_internal(argp_v=6171899936) at ruby.c:2500:5
	...
	```
	---
	 error.c                   |  4 +++-
	 test/ruby/test_require.rb | 15 +++++++++++++++
	 2 files changed, 18 insertions(+), 1 deletion(-)
2023-08-12 13:48:14 +09:00
nagachika
19823032ab merge revision(s) 954b7ac81e: [Backport #19789]
addr2line.c: fix `DW_FORM_ref_addr` parsing for DWARF 2 (#8146)

	addr2line.c: fix DW_FORM_ref_addr parsing for DWARF 2

	This fixes a crash when retrieving backtrace info with YJIT enabled on
	macOS with Rust 1.71.0. Since Rust 1.71.0, the DWARF info generated by
	the Rust compiler uses DW_FORM_ref_addr instead of DW_FORM_ref4 for
	pointers to other DIEs.
	DW_FORM_ref_addr representation in DWARF 2 is different from DWARF 3+,
	so we need to handle it separately.
	This patch fixes the parsing of DW_FORM_ref_addr for DWARF 2, which is
	the default DWARF version Rustc uses on macOS.

	See the DWARF 2.0.0 spec, section 7.5.4 Attribute Encodings
	https://dwarfstd.org/doc/dwarf-2.0.0.pdf

	https://bugs.ruby-lang.org/issues/19789
	---
	 addr2line.c | 40 ++++++++++++++++++++++++++--------------
	 1 file changed, 26 insertions(+), 14 deletions(-)
2023-08-12 13:46:25 +09:00
nagachika
1c76244698 Revert "Ruby 3.2 - Speed up rebuilding the loaded feature index and realpath cache (#8023)"
This reverts commit 8346d1630b.
It seems break CI on MinGW.
1544745598
2023-07-29 17:58:42 +09:00
Kerem Kat
8346d1630b
Ruby 3.2 - Speed up rebuilding the loaded feature index and realpath cache (#8023)
* Speed up rebuilding the loaded feature index

Rebuilding the loaded feature index slowed down with the bug fix
for #17885 in 79a4484a07.  The
slowdown was extreme if realpath emulation was used, but even when
not emulated, it could be about 10x slower.

This adds loaded_features_realpath_map to rb_vm_struct. This is a
hidden hash mapping loaded feature paths to realpaths. When
rebuilding the loaded feature index, look at this hash to get
cached realpath values, and skip calling rb_check_realpath if a
cached value is found.

Fixes [Bug #19246]

* Add a realpath cache to reduce number of syscalls.

Number of lstat and stat syscalls for each 'require'd file is doubled,
because rb_realpath_internal is called from two places with the same
arguments in require_internal; once for checking the realpaths cache,
and once in load_iseq_eval when iseq is not found.

Introduce rb_realpath_internal_cached function to reuse the realpath_map
cache which memoizes rb_realpath_internal function, leading to less
syscalls and increased startup performance depending on the cost of the syscalls
in a particular environment.

---------

Co-authored-by: Jeremy Evans <code@jeremyevans.net>
2023-07-29 05:27:11 +00:00
nagachika
19a3466a14 merge revision(s) cada537040: [Backport #19786]
[DOC] Fix call-seq for Data.define

	---
	 struct.c | 4 +---
	 1 file changed, 1 insertion(+), 3 deletions(-)
2023-07-29 14:04:01 +09:00
nagachika
9f5c32ce85 merge revision(s) 99162dee7a: [Backport #19751]
[Bug #19751] Remove linemarkers in middle

	---
	 template/fake.rb.in | 1 +
	 1 file changed, 1 insertion(+)
2023-07-29 13:54:10 +09:00
nagachika
0b3ed6043c merge revision(s) 5d4fff8456: [Backport #19293]
Tighten Time.new(string) parsing

	Disallow:

	* Only year-month
	* Only year-month-day
	* Preceding whitespace
	* Trailing whitespace

	Fixes [Bug #19293]
	---
	 test/ruby/test_time.rb | 13 +++++++++++++
	 time.c                 | 13 ++++++++++++-
	 2 files changed, 25 insertions(+), 1 deletion(-)
2023-07-23 12:20:12 +09:00
nagachika
3354aacb73 merge revision(s) 3874381c44: [Backport #19759]
Fix autosplat conditions to handle ruby2_keywords case

	Autosplat should not occur if there are two arguments but second
	argument is an array containing a ruby2_keywords splat. Only
	autosplat if a single argument to be yielded to the block, and there
	is no splatted flagged keyword hash passed.

	Fixes [Bug #19759]
	---
	 test/ruby/test_proc.rb | 26 ++++++++++++++++++++++++++
	 vm_args.c              |  3 ++-
	 2 files changed, 28 insertions(+), 1 deletion(-)
2023-07-23 12:01:21 +09:00
nagachika
b97a744a37 merge revision(s) 9c94db7cfc584e982a6449b72e58a1cf25024177,fe4d906f5fbacbe6e9267af3bd3503339bad63a9: [Backport #19774]
Add tests for `return` in `BEGIN` and `END` blocks

	---
	 spec/ruby/language/return_spec.rb | 15 +++++++++++++++
	 test/ruby/test_syntax.rb          |  1 +
	 2 files changed, 16 insertions(+)

	[Bug #19774] Fix segfault at `return` in `END`

	---
	 eval_error.c             | 7 ++++++-
	 test/ruby/test_syntax.rb | 5 +++++
	 2 files changed, 11 insertions(+), 1 deletion(-)
2023-07-22 14:01:55 +09:00
nagachika
65d294ad01 merge revision(s) bc3ac1872e: [Backport #19748]
[Bug #19748] Fix out-of-bound access in `String#byteindex`

	---
	 string.c                 | 17 +++++++----------
	 test/ruby/test_string.rb |  3 +++
	 2 files changed, 10 insertions(+), 10 deletions(-)
2023-07-22 13:39:44 +09:00
nagachika
35cf3a5f8d merge revision(s) 038f9ade3c: [Backport #19585]
Use tools appropriate with CC

	To get rid of mysterious errors such as:

	```
	/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm: error: libruby.3.3-static.a(/): The end of the file was unexpectedly encountered
	```

	and

	```
	ld: warning: ignoring file ../../libruby.3.3-static.a, building for macOS-x86_64 but attempting to link with file built for macOS-x86_64
	Undefined symbols for architecture x86_64:
	  "_rb_rational_num", referenced from:
	```
	---
	 configure.ac | 6 ++++++
	 1 file changed, 6 insertions(+)
2023-07-22 13:32:30 +09:00
nagachika
4e0653db33 merge revision(s) 2c8f2871a8: [Backport #19532]
Fix handling of 6-byte codepoints in left_adjust_char_head in CESU-8
	 encoding

	---
	 enc/cesu_8.c                | 23 +++++++++++++++++++----
	 test/ruby/enc/test_cesu8.rb |  4 ++++
	 2 files changed, 23 insertions(+), 4 deletions(-)
2023-07-22 13:31:34 +09:00
nagachika
fa72ba72f8 merge revision(s) 54dbd8bea8: [Backport #19535]
Use an st table for "too complex" objects

	st tables will maintain insertion order so we can marshal dump / load
	objects with instance variables in the same order they were set on that
	particular instance

	[ruby-core:112926] [Bug #19535]

	Co-Authored-By: Jemma Issroff <jemmaissroff@gmail.com>
	---
	 gc.c                     | 10 ++++------
	 include/ruby/st.h        |  2 ++
	 object.c                 |  2 +-
	 ractor.c                 | 43 ++++++++++++++++++++++---------------------
	 shape.h                  |  6 +++---
	 st.c                     |  6 ++++++
	 test/ruby/test_shapes.rb | 21 +++++++++++++++++++++
	 variable.c               | 28 ++++++++++++++--------------
	 vm_insnhelper.c          |  2 +-
	 9 files changed, 74 insertions(+), 46 deletions(-)
2023-07-22 13:24:55 +09:00
nagachika
a3911b965f merge revision(s) 0402193723: [Backport #19709]
Fix `Thread#join(timeout)` when running inside the fiber scheduler.
	 (#7903)

	---
	 test/fiber/test_thread.rb | 22 ++++++++++++++++++++++
	 thread.c                  |  5 +++++
	 2 files changed, 27 insertions(+)
2023-07-22 13:08:16 +09:00
nagachika
ea89527a76 merge revision(s) 0b2613f443: [Backport #19640]
`rb_io_puts` should not write zero length strings. (#7806)

	---
	 io.c                  | 40 ++++++++++++++++++++++++----------------
	 test/fiber/test_io.rb | 28 ++++++++++++++++++++++++++++
	 2 files changed, 52 insertions(+), 16 deletions(-)
2023-07-22 13:03:22 +09:00
nagachika
465eb7418d merge revision(s) 91c004885f: [Backport #19025]
[Bug #19025] Numbered parameter names are always local variables

	---
	 parse.y                  | 2 +-
	 test/ruby/test_syntax.rb | 1 +
	 2 files changed, 2 insertions(+), 1 deletion(-)
2023-07-22 11:55:49 +09:00
nagachika
e65e0b9926 merge revision(s) fac814c2dc: [Backport #19602]
Fix `PLATFORM_GET_INC`

	On platforms where unaligned word access is not allowed, and if
	`sizeof(val)` and `sizeof(type)` differ:

	- `val` > `type`, `val` will be a garbage.
	- `val` < `type`, outside `val` will be clobbered.
	---
	 regexec.c | 2 +-
	 regint.h  | 9 ++++++++-
	 2 files changed, 9 insertions(+), 2 deletions(-)
2023-07-22 11:48:47 +09:00
nagachika
46b62f44ce merge revision(s) 3592b24cdc: [Backport #19531]
ObjectSpace::WeakMap: clean inverse reference when an entry is
	 re-assigned

	[Bug #19531]

	```ruby
	wmap[1] = "A"
	wmap[1] = "B"
	```

	In the example above, we need to remove the `"A" => 1` inverse reference
	so that when `"A"` is GCed the `1` key isn't deleted.
	---
	 test/ruby/test_weakmap.rb | 17 +++++++++
	 weakmap.c                 | 91 ++++++++++++++++++++++++++++++++++++++---------
	 2 files changed, 91 insertions(+), 17 deletions(-)
2023-07-22 11:44:54 +09:00
nagachika
3f6187a947 merge revision(s) 1bc8838d60: [Backport #19750]
Handle unterminated unicode escapes in regexps

	This fixes an infinite loop possible after ec3542229b.
	For \u{} escapes in regexps, skip validation in the parser, and rely on the regexp
	code to handle validation. This is necessary so that invalid unicode escapes in
	comments in extended regexps are allowed.

	Fixes [Bug #19750]

	Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
	---
	 parse.y                 | 97 ++++++++++++++++++++++++++++++++-----------------
	 test/ruby/test_parse.rb | 16 ++++++++
	 2 files changed, 79 insertions(+), 34 deletions(-)
2023-07-17 18:04:41 +09:00