From: River Riddle Date: Thu, 16 Apr 2020 00:41:31 +0000 (-0700) Subject: [mlir][Inliner] Store the resolved call by-value instead of by-reference X-Git-Tag: llvmorg-12-init~8876 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4f37450b2cb2dfc3c201a1b87f25062560ef3327;p=platform%2Fupstream%2Fllvm.git [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 --- 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();