[mlir][msan] Don't access destroyed node
authorVitaly Buka <vitalybuka@google.com>
Wed, 27 Apr 2022 23:07:21 +0000 (16:07 -0700)
committerVitaly Buka <vitalybuka@google.com>
Thu, 28 Apr 2022 15:58:27 +0000 (08:58 -0700)
mlir/lib/Dialect/Affine/Transforms/LoopFusion.cpp

index bf028c3..6e633cf 100644 (file)
@@ -1949,8 +1949,9 @@ public:
     // edges, and it does not write to a memref which escapes the
     // function.
     if (mdg->getOutEdgeCount(sibNode->id) == 0) {
+      Operation *op = sibNode->op;
       mdg->removeNode(sibNode->id);
-      sibNode->op->erase();
+      op->erase();
     }
   }