YJIT: Fix insufficient type guards (#9911)

This commit is contained in:
Takashi Kokubun 2024-02-12 08:55:52 -08:00 коммит произвёл GitHub
Родитель c3886c12dc
Коммит b9f25b100f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -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);
}
}