File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -863,8 +863,11 @@ std::unique_ptr<ASTUnit> ASTUnit::LoadFromASTFile(
863863 // explicitly forward the buffer.
864864 if (Filename == " -" )
865865 if (auto FE = llvm::expectedToOptional (TmpFileMgr.getSTDIN ()))
866- if (auto Buf = TmpFileMgr.getBufferForFile (*FE))
867- AST->Reader ->getModuleManager ().addInMemoryBuffer (" -" , std::move (*Buf));
866+ if (auto BufRef = TmpFileMgr.getBufferForFile (*FE)) {
867+ auto Buf = llvm::MemoryBuffer::getMemBufferCopy (
868+ (*BufRef)->getBuffer (), (*BufRef)->getBufferIdentifier ());
869+ AST->Reader ->getModuleManager ().addInMemoryBuffer (" -" , std::move (Buf));
870+ }
868871
869872 // Reinstate the provided options that are relevant for reading AST files.
870873 AST->HSOpts ->ForceCheckCXX20ModulesInputFiles =
You can’t perform that action at this time.
0 commit comments