mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[serialization] Yet Another Misuse of ArrayRef (#5216)
I wonder if we can assert that the lifetime is valid or something. rdar://problem/28699599
This commit is contained in:
@@ -1119,8 +1119,9 @@ Status ModuleFile::associateWithFileContext(FileUnit *file,
|
||||
auto scopeID = ctx.getIdentifier(scopePath);
|
||||
assert(!scopeID.empty() &&
|
||||
"invalid decl name (non-top-level decls not supported)");
|
||||
auto path = Module::AccessPathTy({scopeID, SourceLoc()});
|
||||
dependency.Import = { ctx.AllocateCopy(path), module };
|
||||
std::pair<Identifier, SourceLoc> accessPathElem(scopeID, SourceLoc());
|
||||
dependency.Import = {ctx.AllocateCopy(llvm::makeArrayRef(accessPathElem)),
|
||||
module};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user