From: Argyrios Kyrtzidis Date: Thu, 28 Jun 2012 21:03:08 +0000 (+0000) Subject: [libclang] Don't bind a StringRef to a temporary std::string object. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3791814b2c5efb3986ec4dd40c75c9d28f325222;p=clang [libclang] Don't bind a StringRef to a temporary std::string object. It may end up pointing at garbage. Fixes the MSVC debug build. rdar://11703319 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159377 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/libclang/Indexing.cpp b/tools/libclang/Indexing.cpp index e660c4d6eb..6b681340f1 100644 --- a/tools/libclang/Indexing.cpp +++ b/tools/libclang/Indexing.cpp @@ -369,7 +369,6 @@ static void clang_indexSourceFile_Impl(void *UserData) { IndexActionCleanup(IndexAction.get()); bool Persistent = requestedToGetTU; - StringRef ResourceFilesPath = CXXIdx->getClangResourcesPath(); bool OnlyLocalDecls = false; bool PrecompilePreamble = false; bool CacheCodeCompletionResults = false; @@ -393,7 +392,7 @@ static void clang_indexSourceFile_Impl(void *UserData) { IndexAction.get(), Unit, Persistent, - ResourceFilesPath, + CXXIdx->getClangResourcesPath(), OnlyLocalDecls, /*CaptureDiagnostics=*/true, PrecompilePreamble,