add nullptr check to mitigate crashes

wip for reach untracked tags build fixes
This commit is contained in:
Uraniumm 2022-08-08 02:02:25 -04:00 committed by GitHub
parent f45e9e5e9a
commit a16acbaf59
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -795,8 +795,11 @@ bool SimplificationPass::CheckScalarConstCmp(hir::Instr* i,
if (var_definition) {
var_definition = var_definition->GetDestDefSkipAssigns();
if (var_definition != NULL)
{
def_opcode = var_definition->opcode->num;
}
}
// x == 0 -> !x
if (cmpop == OPCODE_COMPARE_EQ && constant_unpacked == 0) {
i->Replace(&OPCODE_IS_FALSE_info, 0);