Files
nagachika 949af69408 merge revision(s) 5680c38c75aeb5cbd219aafa8eb48c315f287d97,f5d20411386ff2552ff27661387ddc4bae1ebc30: [Backport #17573]
Use valid `ec` for postponed job.

	Postponed job can be registered from non-Ruby thread, which means
	`ec` in TLS can be NULL. In this case, use main thread's `ec` instead.

	See https://github.com/ruby/ruby/pull/4108
	and https://github.com/ruby/ruby/pull/4336
	---
	 vm_trace.c | 16 ++++++++++++----
	 1 file changed, 12 insertions(+), 4 deletions(-)

	Avoid assert failure when NULL EC is expected

	After 5680c38c75, postponed job APIs now
	expect to be called on native threads not managed by Ruby and handles
	getting a NULL execution context. However, in debug builds the change
	runs into an assertion failure with GET_EC() which asserts that EC is
	non-NULL. Avoid the assertion failure by passing `false` for `expect_ec`
	instead as the intention is to handle when there is no EC.

	Add a test from John Crepezzi and John Hawthorn to exercise this
	situation.

	See GH-4108
	See GH-5094

	[Bug #17573]

	Co-authored-by: John Hawthorn <john@hawthorn.email>
	Co-authored-by: John Crepezzi <john.crepezzi@gmail.com>
	---
	 ext/-test-/postponed_job/postponed_job.c       | 31 ++++++++++++++++++++++++++
	 test/-ext-/postponed_job/test_postponed_job.rb |  7 ++++++
	 vm_trace.c                                     |  2 +-
	 3 files changed, 39 insertions(+), 1 deletion(-)
2021-11-23 14:52:30 +09:00
..
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2016-07-06 05:48:13 +00:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-09-08 10:30:07 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-12-22 02:51:49 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2020-12-22 02:51:49 +09:00
2020-08-27 16:42:06 +09:00
2020-08-27 16:42:06 +09:00
2018-01-15 12:25:24 +00:00