forked from OSchip/llvm-project
[mlir] Fix bug in ForwardDataFlowAnalysis solver
Explicitly check for uninitialized to prevent crashes in edge cases where the derived analysis creates a lattice element for a value that hasn't been visited yet.
This commit is contained in:
parent
cbce28f07e
commit
82bcd98586
|
@ -317,7 +317,7 @@ void ForwardDataFlowSolver::visitOperation(Operation *op) {
|
||||||
for (Value operand : op->getOperands()) {
|
for (Value operand : op->getOperands()) {
|
||||||
AbstractLatticeElement *operandLattice =
|
AbstractLatticeElement *operandLattice =
|
||||||
analysis.lookupLatticeElement(operand);
|
analysis.lookupLatticeElement(operand);
|
||||||
if (!operandLattice)
|
if (!operandLattice || operandLattice->isUninitialized())
|
||||||
return;
|
return;
|
||||||
operandLattices.push_back(operandLattice);
|
operandLattices.push_back(operandLattice);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue