[flang-commits] [flang] [flang][CodeGen] Fix use-after-free in BoxedProcedurePass (PR #84376)

Krzysztof Parzyszek via flang-commits flang-commits at lists.llvm.org
Fri Mar 8 05:27:04 PST 2024


================
@@ -208,7 +208,12 @@ class BoxedProcedurePass
       mlir::IRRewriter rewriter(context);
       BoxprocTypeRewriter typeConverter(mlir::UnknownLoc::get(context));
       mlir::Dialect *firDialect = context->getLoadedDialect("fir");
-      getModule().walk([&](mlir::Operation *op) {
+      llvm::SmallVector<mlir::Operation *> operations;
+
+      getModule().walk([&](mlir::Operation *op) { operations.push_back(op); });
----------------
kparzysz wrote:

You're right---the default walking is post-order.  Let me check that again.

https://github.com/llvm/llvm-project/pull/84376


More information about the flang-commits mailing list