From c660aaf439dcd609e4e23253372c8ec6d567ce10 Mon Sep 17 00:00:00 2001 From: nagachika Date: Tue, 21 Mar 2023 12:10:35 +0900 Subject: merge revision(s) aeddc19340c7116d48fac3080553fbb823857d16: [Backport #19316] YJIT: Save PC and SP before calling leaf builtins (#7090) Previously, we did not update `cfp->sp` before calling the C function of ISEQs marked with `Primitive.attr! "inline"` (leaf builtins). This caused the GC to miss temporary values on the stack in case the function allocates and triggers a GC run. Right now, there is only a few leaf builtins in numeric.rb on Integer methods such as `Integer#~`. Since these methods only allocate when operating on big numbers, we missed this issue. Fix by saving PC and SP before calling the functions -- our usual protocol for calling C functions that may allocate on the GC heap. [Bug #19316] --- test/ruby/test_yjit.rb | 16 ++++++++++++++++ yjit/src/codegen.rs | 4 ++++ 2 files changed, 20 insertions(+) --- version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'version.h') diff --git a/version.h b/version.h index fb6cd1f326..679bfeed80 100644 --- a/version.h +++ b/version.h @@ -11,7 +11,7 @@ # define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR #define RUBY_VERSION_TEENY 4 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR -#define RUBY_PATCHLEVEL 196 +#define RUBY_PATCHLEVEL 197 #define RUBY_RELEASE_YEAR 2023 #define RUBY_RELEASE_MONTH 3 -- cgit v1.2.3