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
1 changed files with 4 additions and 1 deletions

View File

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