diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2023-08-17 16:46:56 -0400 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2023-08-17 17:17:31 -0400 |
commit | 5d48825d55bedd1d0d9f975efa01cfc443b2451c (patch) | |
tree | 2e8ac9f963841cbd4f2dbcb37e7506c422437b28 /yjit | |
parent | 518d5ab5c8be9372b5409984773eeadc1980cd10 (diff) |
YJIT: Fix String#<< return type
We previously falsely asserted that String#<< always returns a ::String
instance. Issue was discovered on CI with `--yjit-verify-ctx`.
https://github.com/ruby/ruby/actions/runs/5893760435/job/15986002531
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/8240
Diffstat (limited to 'yjit')
-rw-r--r-- | yjit/src/codegen.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs index 1fe0b480e5..df02ab0cc7 100644 --- a/yjit/src/codegen.rs +++ b/yjit/src/codegen.rs @@ -4764,7 +4764,7 @@ fn jit_rb_str_concat( asm.spill_temps(); // for ccall let ret_opnd = asm.ccall(rb_yjit_str_simple_append as *const u8, vec![recv, concat_arg]); let ret_label = asm.new_label("func_return"); - let stack_ret = asm.stack_push(Type::CString); + let stack_ret = asm.stack_push(Type::TString); asm.mov(stack_ret, ret_opnd); asm.stack_pop(1); // forget stack_ret to re-push after ccall asm.jmp(ret_label); @@ -4773,7 +4773,7 @@ fn jit_rb_str_concat( asm.write_label(enc_mismatch); asm.spill_temps(); // for ccall let ret_opnd = asm.ccall(rb_str_buf_append as *const u8, vec![recv, concat_arg]); - let stack_ret = asm.stack_push(Type::CString); + let stack_ret = asm.stack_push(Type::TString); asm.mov(stack_ret, ret_opnd); // Drop through to return |