[Matrix] Fix heap-use-after-free after 0fa373c77d.
We need to skip instructions in FusedInsts, as they may have been deleted. Fixes a heap-use-after-free after #141681.
This commit is contained in:
@@ -1140,6 +1140,9 @@ public:
|
||||
// Fourth, pre-process all the PHINode's. The incoming values will be
|
||||
// assigned later in VisitPHI.
|
||||
for (Instruction *Inst : MatrixInsts) {
|
||||
if (FusedInsts.count(Inst))
|
||||
continue;
|
||||
|
||||
auto *PHI = dyn_cast<PHINode>(Inst);
|
||||
if (!PHI)
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user