]> granicus.if.org Git - clang/commitdiff
[ASTUnit] Unlike LoadFromCommandLine, LoadFromCompilerInvocation causes a crash if...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 21 Jan 2013 18:45:42 +0000 (18:45 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 21 Jan 2013 18:45:42 +0000 (18:45 +0000)
is set to true because there is no FileManager at that point.

Patch by Hurcan Solter!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173071 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/ASTUnit.cpp

index 9ab3a8faba4e14b61b4632e7e0672cb0c6bf328f..4feaad81e64ec9b07fa3c7396c9039b362e81ea8 100644 (file)
@@ -1912,6 +1912,8 @@ ASTUnit *ASTUnit::LoadFromCompilerInvocation(CompilerInvocation *CI,
   AST->IncludeBriefCommentsInCodeCompletion
     = IncludeBriefCommentsInCodeCompletion;
   AST->Invocation = CI;
+  AST->FileSystemOpts = CI->getFileSystemOpts();
+  AST->FileMgr = new FileManager(AST->FileSystemOpts);
   AST->UserFilesAreVolatile = UserFilesAreVolatile;
   
   // Recover resources if we crash before exiting this method.