diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb index fc579dd4c2..5c655b8f25 100644 --- a/bootstraptest/test_yjit.rb +++ b/bootstraptest/test_yjit.rb @@ -3520,3 +3520,11 @@ assert_equal 'ok', %q{ cw(4) } + +assert_normal_exit %{ + class Bug20997 + def foo(&) = self.class.name(&) + + new.foo + end +} diff --git a/version.h b/version.h index 481a9950f7..753c018921 100644 --- a/version.h +++ b/version.h @@ -11,7 +11,7 @@ # define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR #define RUBY_VERSION_TEENY 6 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR -#define RUBY_PATCHLEVEL 251 +#define RUBY_PATCHLEVEL 252 #include "ruby/version.h" #include "ruby/internal/abi.h" diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs index f8107aff3e..2eb63398f3 100644 --- a/yjit/src/codegen.rs +++ b/yjit/src/codegen.rs @@ -4584,8 +4584,8 @@ fn gen_send_cfunc( return CantCompile; } - // Delegate to codegen for C methods if we have it. - if kw_arg.is_null() && flags & VM_CALL_OPT_SEND == 0 && flags & VM_CALL_ARGS_SPLAT == 0 && (cfunc_argc == -1 || argc == cfunc_argc) { + // Delegate to codegen for C methods if we have it and the callsite is simple enough. + if kw_arg.is_null() && flags & VM_CALL_OPT_SEND == 0 && flags & VM_CALL_ARGS_SPLAT == 0 && flags & VM_CALL_ARGS_BLOCKARG == 0 && (cfunc_argc == -1 || argc == cfunc_argc) { let codegen_p = lookup_cfunc_codegen(unsafe { (*cme).def }); let expected_stack_after = ctx.get_stack_size() as i32 - argc; if let Some(known_cfunc_codegen) = codegen_p {