From 4f37450b2cb2dfc3c201a1b87f25062560ef3327 Mon Sep 17 00:00:00 2001 From: River Riddle Date: Wed, 15 Apr 2020 17:41:31 -0700 Subject: [PATCH] [mlir][Inliner] Store the resolved call by-value instead of by-reference This avoids asan failures as more calls may be added during inlining, invalidating the reference. Differential Revision: https://reviews.llvm.org/D78258 --- mlir/lib/Transforms/Inliner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlir/lib/Transforms/Inliner.cpp b/mlir/lib/Transforms/Inliner.cpp index f797ca8f..9826f5c 100644 --- a/mlir/lib/Transforms/Inliner.cpp +++ b/mlir/lib/Transforms/Inliner.cpp @@ -455,7 +455,7 @@ inlineCallsInSCC(Inliner &inliner, CGUseList &useList, // here as more calls may be added during inlining. bool inlinedAnyCalls = false; for (unsigned i = 0; i != calls.size(); ++i) { - ResolvedCall &it = calls[i]; + ResolvedCall it = calls[i]; LLVM_DEBUG({ llvm::dbgs() << "* Considering inlining call: "; it.call.dump(); -- 2.7.4