diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2023-03-23 13:42:49 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-23 13:42:49 -0700 |
commit | b4e438d8aabaf4bba2b27f374c787543fae07c58 (patch) | |
tree | ef14adb0d5e65098da72184071a52f0d1166f19a /yjit/src/codegen.rs | |
parent | 8286544dc5518f59bd607f6b6f8870fd22b3bac7 (diff) | |
download | ruby-b4e438d8aabaf4bba2b27f374c787543fae07c58.tar.gz |
YJIT: Save PC on rb_str_concat (#7586)
[Bug #19483]
Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
Diffstat (limited to 'yjit/src/codegen.rs')
-rw-r--r-- | yjit/src/codegen.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs index 79267481fe..513cf9d308 100644 --- a/yjit/src/codegen.rs +++ b/yjit/src/codegen.rs @@ -4479,8 +4479,10 @@ fn jit_rb_str_concat( // Guard that the concat argument is a string guard_object_is_string(ctx, asm, ctx.stack_opnd(0), StackOpnd(0), side_exit); - // Guard buffers from GC since rb_str_buf_append may allocate. - gen_save_sp(asm, ctx); + // Guard buffers from GC since rb_str_buf_append may allocate. During the VM lock on GC, + // other Ractors may trigger global invalidation, so we need ctx.clear_local_types(). + // PC is used on errors like Encoding::CompatibilityError raised by rb_str_buf_append. + jit_prepare_routine_call(jit, ctx, asm); let concat_arg = ctx.stack_pop(1); let recv = ctx.stack_pop(1); |