Граф коммитов

75619 Коммитов

Автор SHA1 Сообщение Дата
nagachika bfa04c0362 merge revision(s) 72f07f0a5f882e87e305d668587152fa209a0568:
Reduce concurrency of Cirrus-CI [ci skip]

	clang-12 takes 2-3 times longer than gcc-11.
	---
	 .cirrus.yml | 4 ----
	 1 file changed, 4 deletions(-)
2023-07-16 18:57:45 +09:00
nagachika c911cbd6c3 merge revision(s) bd786e78969f9d4a8699376ceafe10934b6ad533: [Backport #19084]
Fix mutation on shared strings. (#7837)

	---
	 io_buffer.c                 | 19 ++++++++++++-------
	 test/ruby/test_io_buffer.rb |  4 ----
	 2 files changed, 12 insertions(+), 11 deletions(-)
2023-07-16 16:50:13 +09:00
nagachika 5ad2390b55 merge revision(s) 466aa8010fb49f9ec6c78ea1de4e8ca0965f4fdf: [Backport #19546]
Fix incorrect usage of `rb_fiber_scheduler_io_(p)(read|write)`.
	 (#7593)

	---
	 io_buffer.c                  |  8 ++++----
	 scheduler.c                  | 48 ++++++++++++++++++++++----------------------
	 test/fiber/test_io_buffer.rb | 33 ++++++++++++++++++++++++++++++
	 3 files changed, 61 insertions(+), 28 deletions(-)
2023-07-16 16:44:22 +09:00
nagachika c13757ed9a merge revision(s) 09295ea796900fb7b05d29e93364090e21598566: [Backport #19543]
IO::Buffer#resize: Free internal buffer if new size is zero (#7569)

	`#resize(0)` on an IO::Buffer with internal buffer allocated will
	result in calling `realloc(data->base, 0)`. The behavior of `realloc`
	with size = 0 is implementation-defined (glibc frees the object
	and returns NULL, while BSDs return an inaccessible object). And
	thus such usage is deprecated in standard C (upcoming C23 will make it
	UB).

	To avoid this problem, just `free`s the memory when the new size is zero.
	---
	 io_buffer.c                 |  5 +++++
	 test/ruby/test_io_buffer.rb | 18 ++++++++++++++++++
	 2 files changed, 23 insertions(+)
2023-07-16 16:42:12 +09:00
nagachika 141402d11c merge revision(s) e1bd45624c85e8a80991bda20801f50967ac77a1: [Backport #19482]
Fix crash when allocating classes with newobj hook

	We need to zero out the whole slot when running the newobj hook for a
	newly allocated class because the slot could be filled with garbage,
	which would cause a crash if a GC runs inside of the newobj hook.

	For example, the following script crashes:

	```
	require "objspace"

	GC.stress = true

	ObjectSpace.trace_object_allocations {
	  100.times do
	    Class.new
	  end
	}
	```

	[Bug #19482]
	---
	 gc.c                           | 8 +++++++-
	 test/objspace/test_objspace.rb | 7 +++++++
	 2 files changed, 14 insertions(+), 1 deletion(-)
2023-07-16 12:58:21 +09:00
nagachika 44a8e5e63a merge revision(s) 833b32f503abb9712dbb3a6825b1730c8ee1e912,1dde9d726099fc4e4b06b8c848c85eac195c521b:
also disable yjit for clang < 10

	They don't compile.  I guess nobody actively maintain such old
	compilers.  Chances are the situation won't improve.  Let's stop
	testing yjit on them.
	---
	 .github/workflows/compilers.yml | 8 ++++----
	 1 file changed, 4 insertions(+), 4 deletions(-)

	Explain why YJIT is disabled for clang<=9 [ci skip]

	---
	 .github/workflows/compilers.yml | 1 +
	 1 file changed, 1 insertion(+)
2023-07-16 11:46:12 +09:00
nagachika b13db31ce8 merge revision(s) fe42d88ad28df395111cfb9f2f67e21910083df1:
Pass -Werror=lto-type-mismatch for GCC LTO jobs

	This helps to find possible LTO miscompilations earlier. See also
	https://github.com/ruby/ruby/pull/7695.
	---
	 .github/workflows/compilers.yml | 12 ++++++------
	 1 file changed, 6 insertions(+), 6 deletions(-)
2023-07-16 11:46:04 +09:00
nagachika 3e664c5813 merge revision(s) 27a21ad201b04f9af6c206836b4c7543fb69a1e7:
give up checking old compilers

	These old compilers needed old OSes, which are getting EODed.  We
	cannot maintain healthy binary of them (building compilers on our
	own is quite haed).  Let us just retire them.  Fixes [Bug #19353]
	---
	 .github/workflows/compilers.yml | 6 ------
	 1 file changed, 6 deletions(-)
2023-07-16 11:43:54 +09:00
nagachika eeb4fc2cf8 merge revision(s) dd7c590f8a4dafbc0d659d07645aea59586b0f70,6a871baa3cd759c0eba361b4937eeca531513a09:
disable yjit when for non-flonum

	YJIT does not interface with this flag.
	---
	 .github/workflows/compilers.yml | 2 +-
	 1 file changed, 1 insertion(+), 1 deletion(-)

	Note that YJIT requires FLONUM [ci skip]

	---
	 .github/workflows/compilers.yml | 6 +++++-
	 1 file changed, 5 insertions(+), 1 deletion(-)
2023-07-16 11:36:59 +09:00
nagachika 293a00e622 merge revision(s) 33edcc112081f96856d52e73253d73c97a5c4a3c,b4e438d8aabaf4bba2b27f374c787543fae07c58: [Backport #19483]
YJIT: Protect strings from GC on String#<< (#7466)

	Fix https://github.com/Shopify/yjit/issues/310

	[Bug #19483]

	Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
	Co-authored-by: Jimmy Miller <jimmy.miller@shopify.com>
	---
	 yjit/src/codegen.rs | 3 +++
	 1 file changed, 3 insertions(+)

	YJIT: Save PC on rb_str_concat (#7586)

	[Bug #19483]

	Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
	---
	 test/ruby/test_yjit.rb | 19 +++++++++++++++++++
	 yjit/src/codegen.rs    |  6 ++++--
	 2 files changed, 23 insertions(+), 2 deletions(-)
2023-07-16 11:25:45 +09:00
nagachika 0ba10fd850 merge revision(s) 132934b82baad97107fe754d60f9a68a1db7ecda: [Backport #19463]
YJIT: Generate Block::entry_exit with block entry PC

	Previously, when Block::entry_exit is requested from any instruction
	that is not the first one in the block, we generated the exit with an
	incorrect PC. We should always be using the PC for the entry of the
	block for Block::entry_exit.

	It was a simple typo. The bug was [introduced][1] while we were
	refactoring to use the current backend. Later, we had a chance to spot
	this issue while [preparing][2] to enable unused variable warnings, but
	didn't spot the issue.

	Fixes [Bug #19463]

	[1]: 27fcab995e
	[2]: 31461c7e0e
	---
	 test/ruby/test_yjit.rb | 41 +++++++++++++++++++++++++++++++++++++++++
	 yjit/src/codegen.rs    |  4 ++--
	 2 files changed, 43 insertions(+), 2 deletions(-)
2023-07-16 11:25:45 +09:00
Alan Wu 2f603bc4d7
ruby_3_2 backport for #8006 (#8008)
YJIT: Fix autosplat miscomp for blocks with optionals

When passing an array as the sole argument to `yield`, and the yieldee
takes more than 1 optional parameter, the array is expanded similar
to `*array` splat calls. This is called "autosplat" in
`setup_parameters_complex()`.

Previously, YJIT did not detect this autosplat condition. It passed the
array without expanding it, deviating from interpreter behavior.
Detect this conditon and refuse to compile it.
2023-07-04 15:07:18 +00:00
nagachika 07d5709fee bump patchlevel 2023-07-01 14:18:06 +09:00
eileencodes 038913f1e9 Add missing write barrier
We were missing the write barrier for class_value to cref. This should
fix the segv we were seeing in http://ci.rvm.jp/logfiles/brlog.trunk-gc-asserts.20230601-165052

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2023-07-01 14:17:30 +09:00
eileencodes 8a3d57971c Fix cvar caching when class is cloned
The class variable cache that was added in
https://github.com/ruby/ruby/pull/4544 changed the behavior of class
variables on cloned classes. As reported when a class is cloned AND a
class variable was set, and the class variable was read from the
original class, reading a class variable from the cloned class would
return the value from the original class.

This was happening because the IC (inline cache) is stored on the ISEQ
which is shared between the original and cloned class, therefore they
share the cache too.

To fix this we are now storing the `cref` in the cache so that we can
check if it's equal to the current `cref`. If it's different we don't
want to read from the cache. If it's the same we do. Cloned classes
don't share the same cref with their original class.

This will need to be backported to 3.1 in addition to 3.2 since the bug
exists in both versions.

We also added a marking function which was missing.

Fixes [Bug #19379]

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2023-07-01 14:17:30 +09:00
eileencodes 06dae46036 Copy cvar table on clone
When a class with a class variable is cloned we need to also copy the
cvar cache table from the original table to the clone. I found this bug
while working on fixing [Bug #19379]. While this does not fix that bug
directly it is still a required change to fix another bug revealed by
the fix in https://github.com/ruby/ruby/pull/7265

This needs to be backported to 3.2.x and 3.1.x.

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2023-07-01 14:17:30 +09:00
nagachika 814271b2f7 bump patchlevel 2023-07-01 13:48:08 +09:00
Hiroshi SHIBATA bbf1eb4097 Merge URI-0.12.2 for Bundler 2023-07-01 13:46:09 +09:00
Hiroshi SHIBATA dd73fe077c Merge URI-0.12.2 2023-07-01 13:46:09 +09:00
nagachika b422c3523c merge revision(s) 7bd7aee02e303de27d2cddfc5ef47e612d6782cb: [Backport #18464]
Fix interpreter crash caused by RUBY_INTERNAL_EVENT_NEWOBJ + Ractors

	When a Ractor is created whilst a tracepoint for
	RUBY_INTERNAL_EVENT_NEWOBJ is active, the interpreter crashes. This is
	because during the early setup of the Ractor, the stdio objects are
	created, which allocates Ruby objects, which fires the tracepoint.
	However, the tracepoint machinery tries to dereference the control frame
	(ec->cfp->pc), which isn't set up yet and so crashes with a null pointer
	dereference.

	Fix this by not firing GC tracepoints if cfp isn't yet set up.
	---
	 gc.c                         |  1 +
	 test/objspace/test_ractor.rb | 17 +++++++++++++++++
	 2 files changed, 18 insertions(+)
	 create mode 100644 test/objspace/test_ractor.rb
2023-06-25 15:20:43 +09:00
nagachika 0c00fb5d92 merge revision(s) ec14861f0d7a1e99d3e6667dee2f4c9cc426d5f3:
Update to ruby/spec@7e680fa

	---
	 spec/ruby/core/dir/home_spec.rb      | 5 +++--
	 spec/ruby/core/process/spawn_spec.rb | 2 +-
	 2 files changed, 4 insertions(+), 3 deletions(-)
2023-06-25 12:37:14 +09:00
nagachika e3d10dedf1 merge revision(s) bffadcd6d46ccfccade79ce0efb60ced8eac4483: [Backport #19529]
Add guard to compaction test in WeakMap

	Some platforms don't support compaction, so we should skip this test.
	---
	 test/ruby/test_weakmap.rb | 2 ++
	 1 file changed, 2 insertions(+)
2023-06-25 12:29:49 +09:00
nagachika 3ebcbb537d merge revision(s) 548086b34e3dd125edabf5dc1e46b891fad3ea9c,3dc8cde70078ccb38f5f4b0818ad5eecded01bd5,e0cf80d666d4b5df3229f030a16d10d21323508e: [Backport #19529]
ObjectSpace::WeakMap: fix compaction support

	[Bug #19529]

	`rb_gc_update_tbl_refs` can't be used on `w->obj2wmap` because it's
	not a `VALUE -> VALUE` table, but a `VALUE -> VALUE *` table, so
	we need some dedicated iterator.
	---
	 test/ruby/test_weakmap.rb |  8 ++++++++
	 weakmap.c                 | 37 ++++++++++++++++++++++++++++++++++++-
	 2 files changed, 44 insertions(+), 1 deletion(-)

	Fix crash during compaction

	[Bug #19529]

	The fix for [Bug #19529] in commit 548086b contained a bug that crashes
	on the following script:

	```
	wm = ObjectSpace::WeakMap.new
	obj = Object.new
	100.times do
	  wm[Object.new] = obj
	  GC.start
	end
	GC.compact
	```
	---
	 test/ruby/test_weakmap.rb | 10 ++++++++++
	 weakmap.c                 |  2 +-
	 2 files changed, 11 insertions(+), 1 deletion(-)

	Fix incorrect size of WeakMap buffer

	In wmap_final_func, j is the number of elements + 1 (since j also
	includes the length at the 0th index), so we should resize the buffer
	to size j and the new length is j - 1.
	---
	 weakmap.c | 4 ++--
	 1 file changed, 2 insertions(+), 2 deletions(-)
2023-06-25 12:26:20 +09:00
nagachika a048f7882a merge revision(s) 1cdf8ab07b24ebd16e93621957196e8b1d67f2ba: [Backport #19323]
[Bug #19323] Raise `RangeError` instead of integer overflow

	---
	 bignum.c                  |  5 ++++-
	 test/ruby/test_integer.rb | 18 ++++++++----------
	 2 files changed, 12 insertions(+), 11 deletions(-)
2023-06-25 11:52:21 +09:00
nagachika 9fca561980 merge revision(s) cd5e6cc0ea48353c88d921b885b552dc76da255c,bbf54ec334fe2edd7669a944d88d17efde49a412: [Backport #19307]
Update to ruby/mspec@fef9b81

	---
	 spec/mspec/tool/tag_from_output.rb | 2 +-
	 1 file changed, 1 insertion(+), 1 deletion(-)

	Update to ruby/spec@9d69b95

	---
	 spec/ruby/core/array/keep_if_spec.rb               |   1 +
	 spec/ruby/core/array/pack/c_spec.rb                |  14 +-
	 spec/ruby/core/array/pack/shared/basic.rb          |  40 ++++
	 spec/ruby/core/array/pack/shared/float.rb          |  66 ++++++-
	 spec/ruby/core/array/pack/shared/integer.rb        |  96 +++++++--
	 spec/ruby/core/array/pack/shared/numeric_basic.rb  |  10 +-
	 spec/ruby/core/array/pack/shared/unicode.rb        |  14 +-
	 spec/ruby/core/array/pack/w_spec.rb                |  14 +-
	 spec/ruby/core/array/shared/unshift.rb             |  18 ++
	 spec/ruby/core/array/values_at_spec.rb             |   1 +
	 spec/ruby/core/array/zip_spec.rb                   |   6 +
	 spec/ruby/core/class/subclasses_spec.rb            |  22 +++
	 spec/ruby/core/dir/home_spec.rb                    |  44 +++--
	 spec/ruby/core/dir/mkdir_spec.rb                   |  18 +-
	 spec/ruby/core/enumerable/zip_spec.rb              |   5 +
	 spec/ruby/core/float/comparison_spec.rb            |  35 ++--
	 spec/ruby/core/float/divmod_spec.rb                |   2 +-
	 spec/ruby/core/float/gt_spec.rb                    |  21 ++
	 spec/ruby/core/float/gte_spec.rb                   |  21 ++
	 spec/ruby/core/float/lt_spec.rb                    |  21 ++
	 spec/ruby/core/float/lte_spec.rb                   |  21 ++
	 spec/ruby/core/float/shared/equal.rb               |  21 ++
	 spec/ruby/core/io/gets_spec.rb                     |   4 +
	 spec/ruby/core/io/lineno_spec.rb                   |   9 +-
	 spec/ruby/core/io/new_spec.rb                      |   2 +
	 spec/ruby/core/io/readline_spec.rb                 |   4 +
	 spec/ruby/core/io/readlines_spec.rb                |   4 +
	 spec/ruby/core/io/shared/each.rb                   |   4 +
	 spec/ruby/core/io/shared/new.rb                    |   2 +
	 spec/ruby/core/io/shared/pos.rb                    |   8 +-
	 spec/ruby/core/io/shared/readlines.rb              |   4 +
	 spec/ruby/core/io/sysseek_spec.rb                  |   2 +-
	 spec/ruby/core/kernel/shared/load.rb               |  31 ++-
	 spec/ruby/core/kernel/singleton_class_spec.rb      |   2 +
	 spec/ruby/core/marshal/dump_spec.rb                |  45 ++++-
	 spec/ruby/core/marshal/fixtures/classes.rb         |   4 +
	 spec/ruby/core/matchdata/values_at_spec.rb         |  73 ++++++-
	 spec/ruby/core/module/fixtures/classes.rb          |   1 +
	 spec/ruby/core/module/include_spec.rb              |   4 +-
	 spec/ruby/core/module/prepend_spec.rb              |  12 ++
	 .../ruby/core/objectspace/define_finalizer_spec.rb |  22 +++
	 spec/ruby/core/process/constants_spec.rb           |   1 +
	 spec/ruby/core/process/detach_spec.rb              |  29 +++
	 spec/ruby/core/process/spawn_spec.rb               |  10 +
	 spec/ruby/core/process/times_spec.rb               |   2 +-
	 spec/ruby/core/queue/initialize_spec.rb            |  13 +-
	 spec/ruby/core/refinement/import_methods_spec.rb   |  34 ++++
	 spec/ruby/core/refinement/include_spec.rb          |  27 +++
	 spec/ruby/core/refinement/prepend_spec.rb          |  27 +++
	 spec/ruby/core/regexp/initialize_spec.rb           |   2 +-
	 spec/ruby/core/signal/trap_spec.rb                 |  12 ++
	 spec/ruby/core/string/byteslice_spec.rb            |   6 +
	 spec/ruby/core/string/capitalize_spec.rb           |   4 +
	 spec/ruby/core/string/chars_spec.rb                |   7 +-
	 spec/ruby/core/string/chomp_spec.rb                |   4 +
	 spec/ruby/core/string/chop_spec.rb                 |   4 +
	 spec/ruby/core/string/clone_spec.rb                |   4 +
	 spec/ruby/core/string/delete_prefix_spec.rb        |   4 +
	 spec/ruby/core/string/delete_spec.rb               |   4 +
	 spec/ruby/core/string/delete_suffix_spec.rb        |   4 +
	 spec/ruby/core/string/downcase_spec.rb             |   4 +
	 spec/ruby/core/string/dump_spec.rb                 |  10 +-
	 spec/ruby/core/string/dup_spec.rb                  |   4 +
	 spec/ruby/core/string/lines_spec.rb                |   1 -
	 spec/ruby/core/string/reverse_spec.rb              |   4 +
	 spec/ruby/core/string/scan_spec.rb                 |   6 +
	 spec/ruby/core/string/scrub_spec.rb                |  10 +
	 spec/ruby/core/string/shared/each_line.rb          |   6 +
	 spec/ruby/core/string/shared/partition.rb          |  15 ++
	 spec/ruby/core/string/shared/slice.rb              |  13 +-
	 spec/ruby/core/string/shared/strip.rb              |   4 +
	 spec/ruby/core/string/shared/succ.rb               |   4 +
	 spec/ruby/core/string/split_spec.rb                |  17 +-
	 spec/ruby/core/string/squeeze_spec.rb              |   5 +
	 spec/ruby/core/string/swapcase_spec.rb             |   4 +
	 spec/ruby/core/string/undump_spec.rb               |   2 +-
	 spec/ruby/core/string/unpack/b_spec.rb             |  28 ++-
	 spec/ruby/core/string/unpack/c_spec.rb             |  14 +-
	 spec/ruby/core/string/unpack/h_spec.rb             |  28 ++-
	 spec/ruby/core/string/unpack/shared/basic.rb       |  28 ---
	 spec/ruby/core/string/unpack/shared/float.rb       |  60 +++++-
	 spec/ruby/core/string/unpack/shared/integer.rb     |  88 +++++++--
	 spec/ruby/core/string/unpack/shared/unicode.rb     |  14 +-
	 spec/ruby/core/string/unpack/w_spec.rb             |  14 +-
	 spec/ruby/core/string/unpack1_spec.rb              |  12 +-
	 spec/ruby/core/string/unpack_spec.rb               |  34 ++++
	 spec/ruby/core/string/upcase_spec.rb               |   4 +
	 spec/ruby/core/string/valid_encoding/utf_8_spec.rb | 214 +++++++++++++++++++++
	 spec/ruby/core/struct/values_at_spec.rb            |  55 +++++-
	 spec/ruby/core/symbol/shared/id2name.rb            |   7 +
	 spec/ruby/core/time/at_spec.rb                     |  16 ++
	 spec/ruby/core/time/localtime_spec.rb              |  16 +-
	 spec/ruby/core/time/new_spec.rb                    |  94 +++++++--
	 spec/ruby/core/time/shared/gmtime.rb               |   4 +-
	 spec/ruby/core/time/shared/time_params.rb          |  11 +-
	 spec/ruby/core/time/strftime_spec.rb               |  40 +++-
	 spec/ruby/core/time/utc_spec.rb                    |  41 +++-
	 spec/ruby/core/time/zone_spec.rb                   |  20 +-
	 spec/ruby/core/tracepoint/inspect_spec.rb          |   9 +
	 spec/ruby/fixtures/code/load_wrap_fixture.rb       |  12 ++
	 spec/ruby/fixtures/code/wrap_fixture.rb            |   9 -
	 spec/ruby/language/case_spec.rb                    |   4 +-
	 .../ruby/language/regexp/character_classes_spec.rb |   5 +
	 spec/ruby/library/coverage/running_spec.rb         |  20 ++
	 spec/ruby/library/date/civil_spec.rb               |   7 +-
	 spec/ruby/library/objectspace/fixtures/trace.rb    |   5 +
	 spec/ruby/library/objectspace/trace_spec.rb        |  15 ++
	 spec/ruby/library/openssl/x509/name/verify_spec.rb |   4 +-
	 spec/ruby/library/stringio/initialize_spec.rb      |  85 ++++++++
	 spec/ruby/library/stringio/new_spec.rb             |   8 +
	 spec/ruby/library/stringio/shared/write.rb         |  22 +++
	 spec/ruby/optional/capi/ext/io_spec.c              |  43 +++++
	 spec/ruby/optional/capi/io_spec.rb                 |  15 ++
	 spec/ruby/shared/rational/Rational.rb              |  48 ++---
	 114 files changed, 1963 insertions(+), 245 deletions(-)
	 create mode 100644 spec/ruby/core/marshal/fixtures/classes.rb
	 create mode 100644 spec/ruby/core/refinement/import_methods_spec.rb
	 create mode 100644 spec/ruby/core/refinement/include_spec.rb
	 create mode 100644 spec/ruby/core/refinement/prepend_spec.rb
	 create mode 100644 spec/ruby/core/string/unpack_spec.rb
	 create mode 100644 spec/ruby/core/string/valid_encoding/utf_8_spec.rb
	 create mode 100644 spec/ruby/fixtures/code/load_wrap_fixture.rb
	 delete mode 100644 spec/ruby/fixtures/code/wrap_fixture.rb
	 create mode 100644 spec/ruby/library/coverage/running_spec.rb
	 create mode 100644 spec/ruby/library/objectspace/fixtures/trace.rb
	 create mode 100644 spec/ruby/library/objectspace/trace_spec.rb
	 create mode 100644 spec/ruby/library/stringio/new_spec.rb
2023-06-24 16:59:30 +09:00
Nobuyoshi Nakada f89101fa36 [ruby/openssl] Relax error message check for OpenSSL 3.1
A tentative measures fo https://github.com/ruby/openssl/issues/606.

With OpenSSL 3.1.0, the error message at connection using "self-signed
certificate" seems to return `SSL_R_TLSV1_ALERT_UNKNOWN_CA` instead of
`SSL_R_CERTIFICATE_VERIFY_FAILED`.

https://github.com/ruby/openssl/commit/fc4629d246
2023-06-13 14:01:57 +09:00
Hiroshi SHIBATA 34da58bd17 Try to skip Prime_test.rb 2023-06-13 14:01:57 +09:00
Hiroshi SHIBATA 1b2ad95c25 Run test-unit test without rake task to avoid yard dependency 2023-06-13 14:01:57 +09:00
Hiroshi SHIBATA 60ea850bbe pry is not needed for test-bundled-gems 2023-06-13 14:01:57 +09:00
Takashi Kokubun 60d75a5665 MJIT: Check if self is T_OBJECT before opt_pc jump 2023-06-02 18:55:53 +09:00
Takashi Kokubun ae70d2d786 YJIT: Use #[cfg] instead of if cfg! 2023-06-02 16:30:00 +09:00
Takashi Kokubun 08bf3bcfb7 MJIT: Trigger compaction when the queue is empty 2023-06-02 09:41:40 +09:00
NARUSE, Yui e51014f9c0 v3.2.2p53 2023-03-30 20:06:29 +09:00
NARUSE, Yui 936b705d78 v3.2.1p53 2023-03-30 20:05:11 +09:00
Hiroshi SHIBATA 34d5d10517
Merge Time-0.2.2 (#7623) 2023-03-30 10:54:12 +00:00
NARUSE, Yui 250ff4ff45 gem related automation must run only on master 2023-03-29 00:48:11 +09:00
Nobuyoshi Nakada 00041131e2 Skip failing test on MSWin 2023-03-28 22:47:23 +09:00
NARUSE, Yui 18d3223563 Use merge_group 2023-03-28 21:04:02 +09:00
Hiroshi SHIBATA c3c461c4ff
Merge RubyGems-3.4.10 and Bundler-2.4.10 (#7479)
* Merge RubyGems-3.4.7 and Bundler-2.4.7

* Merge RubyGems-3.4.8 and Bundler-2.4.8

* Skip failing test on MSWin

* Merge RubyGems-3.4.9 and Bundler-2.4.9

* Merge RubyGems-3.4.10 and Bundler-2.4.10

---------

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2023-03-28 11:36:47 +00:00
Hiroshi SHIBATA f8c775cb41
Use URI-0.12.1 for Ruby 3.2 (#7603)
* Merge URI-0.12.1

* Use URI-0.12.1

* Update core_assertions for using assert_linear_performance
2023-03-28 11:36:36 +00:00
NARUSE, Yui 582aadb390 merge revision(s) 2f916812a9b818b432ee7c299e021ec62d4727fb,ac458f6bc3c520c9f23364c85bfb033acda907a6:
Skip test_europe_lisbon on macOS

	until we figure out why it's failing.
	---
	 test/ruby/test_time_tz.rb | 1 +
	 1 file changed, 1 insertion(+)

	Historical timezones of Lisbon in tzdata are unstable

	---
	 test/ruby/test_time_tz.rb | 3 +--
	 1 file changed, 1 insertion(+), 2 deletions(-)
2023-03-28 17:02:53 +09:00
NARUSE, Yui fb4ffce0dd merge revision(s) 680bd9027f8cb7977bbc216609db2f4e3cf199a8: [Backport #19471]
[Bug #19471] `Regexp.compile` should handle keyword arguments

	As well as `Regexp.new`, it should pass keyword arguments to the
	`Regexp#initialize` method.
	---
	 re.c                     | 2 +-
	 test/ruby/test_regexp.rb | 5 +++++
	 2 files changed, 6 insertions(+), 1 deletion(-)
2023-03-28 14:25:13 +09:00
NARUSE, Yui b93e222330 merge revision(s) e7342e76dfd26237c604e42f9a59a1eaa578c94e: [Backport #19485]
[Bug #19485] [DOC] Mention tabs in indentation of heredoc identifier

	Co-Authored-By: sawa (Tsuyoshi Sawada) <sawadatsuyoshi@gmail.com>
	---
	 doc/syntax/literals.rdoc | 6 ++++++
	 1 file changed, 6 insertions(+)
2023-03-23 12:04:46 +09:00
NARUSE, Yui 400ccb16ee merge revision(s) cb22d78354e201ca74eba68a8b4edefb593e6754: [Backport #19536]
Fix frozen status loss when moving objects

	[Bug #19536]

	When objects are moved between size pools, their frozen status is lost
	in the shape. This will cause the frozen check to be bypassed when there
	is an inline cache. For example, the following script should raise a
	FrozenError, but doesn't on Ruby 3.2 and master.

	    class A
	      def add_ivars
	        @a = @b = @c = @d = 1
	      end

	      def set_a
	        @a = 10
	      end
	    end

	    a = A.new
	    a.add_ivars
	    a.freeze

	    b = A.new
	    b.add_ivars
	    b.set_a # Set the inline cache in set_a

	    GC.verify_compaction_references(expand_heap: true, toward: :empty)

	    a.set_a
	---
	 shape.c                      |  2 +-
	 test/ruby/test_gc_compact.rb | 28 ++++++++++++++++++++++++++++
	 2 files changed, 29 insertions(+), 1 deletion(-)
2023-03-23 08:11:23 +09:00
NARUSE, Yui ad6fe84dfa merge revision(s) dddc542e9b61b292d80a96d0d0efbbf58719e3be: [Backport #19476]
[Bug #19476]: correct cache index computation for repetition (#7457)

	---
	 regexec.c                | 4 ++--
	 test/ruby/test_regexp.rb | 5 +++++
	 2 files changed, 7 insertions(+), 2 deletions(-)
2023-03-22 10:34:12 +09:00
NARUSE, Yui 4b4087dce3 merge revision(s) e22c4e8877677ff90805e4a4dcbdef80f4220136: [Backport #19467]
[Bug #19467] correct cache points and counting failure on
	 `OP_ANYCHAR_STAR_PEEK_NEXT` (#7454)

	---
	 regexec.c                | 20 ++++++++++++++++----
	 test/ruby/test_regexp.rb | 10 ++++++++++
	 2 files changed, 26 insertions(+), 4 deletions(-)
2023-03-20 15:06:34 +09:00
NARUSE, Yui 0555303464 merge revision(s) 96d1acfdf6c6b42f2029f44d5b5920961d6efa92: [Backport #19161]
[Bug #19161] Check for TLS usability

	On all platforms using GCC, even other than darwin.
	---
	 configure.ac | 13 +++++++------
	 1 file changed, 7 insertions(+), 6 deletions(-)
2023-03-18 15:02:04 +09:00
NARUSE, Yui f3abe5ba64 merge revision(s) 0700d0fd1c77b4fddf803dea3c10be654df600ff,62c2082f1f726cb90d8c332fbedbecf41d5d82ec: [Backport #19469]
Fix indentation in vm_setivar_default

	---
	 vm_insnhelper.c | 6 +++---
	 1 file changed, 3 insertions(+), 3 deletions(-)

	[Bug #19469] Fix crash when resizing generic iv list

	The following script can sometimes trigger a crash:

	```ruby
	GC.stress = true

	class Array
	  def foo(bool)
	    if bool
	      @a = 1
	      @b = 2
	      @c = 1
	    else
	      @c = 1
	    end
	  end
	end

	obj = []
	obj.foo(true)

	obj2 = []
	obj2.foo(false)

	obj3 = []
	obj3.foo(true)
	```

	This is because vm_setivar_default calls rb_ensure_generic_iv_list_size
	to resize the iv list. However, the call to gen_ivtbl_resize reallocs
	the iv list, and then inserts into the generic iv table. If the
	st_insert triggers a GC then the old iv list will be read during
	marking, causing a use-after-free bug.

	Co-Authored-By: Jemma Issroff <jemmaissroff@gmail.com>
	---
	 internal/variable.h |  2 +-
	 variable.c          | 23 ++++++++++++++++++-----
	 vm_insnhelper.c     |  4 ++--
	 3 files changed, 21 insertions(+), 8 deletions(-)
2023-03-17 13:40:04 +09:00
NARUSE, Yui b309c246ee merge revision(s) d78ae78fd76e556e281a743c75bea4c0bb81ed8c: [Backport #19468]
rb_str_modify_expand: clear the string coderange

	[Bug #19468]

	b0b9f7201a errornously stopped
	clearing the coderange.

	Since `rb_str_modify` clears it, `rb_str_modify_expand`
	should too.
	---
	 string.c | 1 +
	 1 file changed, 1 insertion(+)
2023-03-17 10:56:18 +09:00
NARUSE, Yui b73a073597 merge revision(s) 0eb634ae73cb327ede833b72492f912792a4a9d5: [Backport #19464]
YJIT: Detect and reject `send(:alias_for_send, :foo)`

	Previously, YJIT failed to put the stack into the correct shape when
	`BasicObject#send` calls an alias method for the send method itself.
	This can manifest as strange `NoMethodError`s in the final non-send
	receiver, as [seen][1] with the kt-paperclip gem. I also found a case
	where it makes YJIT fail the stack size assertion while compiling
	`leave`.

	YJIT's `BasicObject#__send__` implementation already rejects sends to
	`send`, but didn't detect sends to aliases of `send`. Adjust the
	detection and reject these cases.

	Fixes [Bug #19464]

	[1]: https://github.com/Shopify/yjit/issues/306
	---
	 test/ruby/test_yjit.rb | 20 ++++++++++++++++++++
	 yjit/src/codegen.rs    | 25 ++++++++++---------------
	 2 files changed, 30 insertions(+), 15 deletions(-)
2023-03-15 16:36:32 +09:00