Skip to content

Commit

Permalink
YJIT: Fix insufficient type guards (#9911)
Browse files Browse the repository at this point in the history
  • Loading branch information
k0kubun committed Feb 12, 2024
1 parent c3886c1 commit b9f25b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions yjit/src/codegen.rs
Expand Up @@ -1658,7 +1658,7 @@ fn guard_object_is_array(
asm.cmp(flags_opnd, (RUBY_T_ARRAY as u64).into());
asm.jne(Target::side_exit(counter));

if Type::UnknownHeap.diff(object_type) != TypeDiff::Incompatible {
if Type::TArray.diff(object_type) != TypeDiff::Incompatible {
asm.ctx.upgrade_opnd_type(object_opnd, Type::TArray);
}
}
Expand Down Expand Up @@ -1690,7 +1690,7 @@ fn guard_object_is_hash(
asm.cmp(flags_opnd, (RUBY_T_HASH as u64).into());
asm.jne(Target::side_exit(counter));

if Type::UnknownHeap.diff(object_type) != TypeDiff::Incompatible {
if Type::THash.diff(object_type) != TypeDiff::Incompatible {
asm.ctx.upgrade_opnd_type(object_opnd, Type::THash);
}
}
Expand Down Expand Up @@ -1722,7 +1722,7 @@ fn guard_object_is_string(
asm.cmp(flags_reg, Opnd::UImm(RUBY_T_STRING as u64));
asm.jne(Target::side_exit(counter));

if Type::UnknownHeap.diff(object_type) != TypeDiff::Incompatible {
if Type::TString.diff(object_type) != TypeDiff::Incompatible {
asm.ctx.upgrade_opnd_type(object_opnd, Type::TString);
}
}
Expand Down

0 comments on commit b9f25b1

Please sign in to comment.