summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2024-02-12 08:55:52 -0800
committerGitHub <noreply@github.com>2024-02-12 11:55:52 -0500
commitb9f25b100f801a0f1d00dfa7afcd450eab58b411 (patch)
tree44687f0393cc44a6d4aa05cb994451c81147ca50
parentc3886c12dc22d5d913605060c603c5f4ddb66594 (diff)
YJIT: Fix insufficient type guards (#9911)
-rw-r--r--yjit/src/codegen.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs
index 322553cce1..ac8670fe40 100644
--- a/yjit/src/codegen.rs
+++ b/yjit/src/codegen.rs
@@ -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);
}
}
@@ -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);
}
}
@@ -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);
}
}