ruby-changes:73329
From: Takashi <ko1@a...>
Date: Tue, 30 Aug 2022 10:05:32 +0900 (JST)
Subject: [ruby-changes:73329] ddca3482ef (master): Check only symbol flag bits (#6301)
https://git.ruby-lang.org/ruby.git/commit/?id=ddca3482ef From ddca3482ef53911ce732c91e715d0439d3b47514 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun <takashikkbn@g...> Date: Mon, 29 Aug 2022 18:05:06 -0700 Subject: Check only symbol flag bits (#6301) * Check only symbol flag bits * Check all 4 bits --- yjit/src/codegen.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs index 07e8500f62..744495eb29 100644 --- a/yjit/src/codegen.rs +++ b/yjit/src/codegen.rs @@ -3454,7 +3454,8 @@ fn jit_guard_known_klass( https://github.com/ruby/ruby/blob/trunk/yjit/src/codegen.rs#L3454 asm.comment("guard object is static symbol"); assert!(RUBY_SPECIAL_SHIFT == 8); - asm.cmp(obj_opnd, Opnd::UImm(RUBY_SYMBOL_FLAG as u64)); + let flag_bits = asm.and(obj_opnd, Opnd::UImm(0xf)); + asm.cmp(flag_bits, Opnd::UImm(RUBY_SYMBOL_FLAG as u64)); jit_chain_guard(JCC_JNE, jit, ctx, asm, ocb, max_chain_depth, side_exit); ctx.upgrade_opnd_type(insn_opnd, Type::ImmSymbol); } -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/