summaryrefslogtreecommitdiff
path: root/yjit/src
diff options
context:
space:
mode:
authorÉtienne Barrié <[email protected]>2024-05-27 11:22:39 +0200
committerJean Boussier <[email protected]>2024-05-28 07:32:33 +0200
commit1376881e9afe6ff673f64afa791cf30f57147ee2 (patch)
treea5ad297473381ac00c593ca2ca1ef93381fd3a00 /yjit/src
parent2114d0af1e5790da365584a38ea7ee58670dc11b (diff)
Stop marking chilled strings as frozen
They were initially made frozen to avoid false positives for cases such as: str = str.dup if str.frozen? But this may cause bugs and is generally confusing for users. [Feature #20205] Co-authored-by: Jean Boussier <[email protected]>
Diffstat (limited to 'yjit/src')
-rw-r--r--yjit/src/codegen.rs2
-rw-r--r--yjit/src/cruby_bindings.inc.rs2
2 files changed, 3 insertions, 1 deletions
diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs
index 747fa1769d..f426dd87ca 100644
--- a/yjit/src/codegen.rs
+++ b/yjit/src/codegen.rs
@@ -5611,7 +5611,7 @@ fn jit_rb_str_uplus(
let recv_opnd = asm.stack_pop(1);
let recv_opnd = asm.load(recv_opnd);
let flags_opnd = asm.load(Opnd::mem(64, recv_opnd, RUBY_OFFSET_RBASIC_FLAGS));
- asm.test(flags_opnd, Opnd::Imm(RUBY_FL_FREEZE as i64));
+ asm.test(flags_opnd, Opnd::Imm(RUBY_FL_FREEZE as i64 | RSTRING_CHILLED as i64));
let ret_label = asm.new_label("stack_ret");
diff --git a/yjit/src/cruby_bindings.inc.rs b/yjit/src/cruby_bindings.inc.rs
index d53e630a4a..3a1de5f674 100644
--- a/yjit/src/cruby_bindings.inc.rs
+++ b/yjit/src/cruby_bindings.inc.rs
@@ -697,6 +697,8 @@ pub struct rb_call_data {
pub ci: *const rb_callinfo,
pub cc: *const rb_callcache,
}
+pub const RSTRING_CHILLED: ruby_rstring_private_flags = 32768;
+pub type ruby_rstring_private_flags = u32;
pub const RHASH_PASS_AS_KEYWORDS: ruby_rhash_flags = 8192;
pub const RHASH_PROC_DEFAULT: ruby_rhash_flags = 16384;
pub const RHASH_ST_TABLE_FLAG: ruby_rhash_flags = 32768;