Skip to content

Commit

Permalink
Check only symbol flag bits (#6301)
Browse files Browse the repository at this point in the history
* Check only symbol flag bits

* Check all 4 bits
  • Loading branch information
k0kubun committed Aug 30, 2022
1 parent 737402e commit ddca348
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion yjit/src/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3454,7 +3454,8 @@ fn jit_guard_known_klass(

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);
}
Expand Down

0 comments on commit ddca348

Please sign in to comment.