mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Serialization] Local allocate ModuleFileSharedCore.ModuleInterfacePath
'ModuleInterfacePath' is passed as 'StringRef' that memory used to reside in ASTContext. But 'ModuleFileSharedCore' should be 'ASTContext' independent. So copy it using its own allocator.
This commit is contained in:
@@ -990,10 +990,8 @@ SerializedModuleLoaderBase::loadModule(SourceLoc importLoc,
|
||||
Ctx.addLoadedModule(M);
|
||||
SWIFT_DEFER { M->setHasResolvedImports(); };
|
||||
|
||||
StringRef moduleInterfacePathStr =
|
||||
Ctx.AllocateCopy(moduleInterfacePath.str());
|
||||
auto *file =
|
||||
loadAST(*M, moduleID.Loc, moduleInterfacePathStr,
|
||||
loadAST(*M, moduleID.Loc, moduleInterfacePath,
|
||||
std::move(moduleInputBuffer), std::move(moduleDocInputBuffer),
|
||||
std::move(moduleSourceInfoInputBuffer), isFramework);
|
||||
if (file) {
|
||||
|
||||
Reference in New Issue
Block a user