From 81c3746b68109c65a117332bce615614376d7b86 Mon Sep 17 00:00:00 2001 From: Teresa Johnson Date: Mon, 2 Nov 2015 20:43:33 +0000 Subject: [PATCH] Fix use-after-free in function index merging code. This was flagged by ASAN when using a test case I will be committing along with D13515. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251827 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/IR/FunctionInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/IR/FunctionInfo.cpp b/lib/IR/FunctionInfo.cpp index 015f1235f6d..d26c7a4e9a0 100644 --- a/lib/IR/FunctionInfo.cpp +++ b/lib/IR/FunctionInfo.cpp @@ -23,7 +23,7 @@ void FunctionInfoIndex::mergeFrom(std::unique_ptr Other, StringRef ModPath; for (auto &OtherFuncInfoLists : *Other) { - StringRef FuncName = OtherFuncInfoLists.getKey(); + std::string FuncName = OtherFuncInfoLists.getKey(); FunctionInfoList &List = OtherFuncInfoLists.second; // Assert that the func info list only has one entry, since we shouldn't -- 2.34.1