[cfe-commits] r159377 - /cfe/trunk/tools/libclang/Indexing.cpp

Argyrios Kyrtzidis akyrtzi at gmail.com
Thu Jun 28 14:03:08 PDT 2012


Author: akirtzidis
Date: Thu Jun 28 16:03:08 2012
New Revision: 159377

URL: http://llvm.org/viewvc/llvm-project?rev=159377&view=rev
Log:
[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

Modified:
    cfe/trunk/tools/libclang/Indexing.cpp

Modified: cfe/trunk/tools/libclang/Indexing.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/Indexing.cpp?rev=159377&r1=159376&r2=159377&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/Indexing.cpp (original)
+++ cfe/trunk/tools/libclang/Indexing.cpp Thu Jun 28 16:03:08 2012
@@ -369,7 +369,6 @@
     IndexActionCleanup(IndexAction.get());
 
   bool Persistent = requestedToGetTU;
-  StringRef ResourceFilesPath = CXXIdx->getClangResourcesPath();
   bool OnlyLocalDecls = false;
   bool PrecompilePreamble = false;
   bool CacheCodeCompletionResults = false;
@@ -393,7 +392,7 @@
                                                        IndexAction.get(),
                                                        Unit,
                                                        Persistent,
-                                                       ResourceFilesPath,
+                                                CXXIdx->getClangResourcesPath(),
                                                        OnlyLocalDecls,
                                                     /*CaptureDiagnostics=*/true,
                                                        PrecompilePreamble,





More information about the cfe-commits mailing list