Skip to content

Commit 5d3a7f7

Browse files
authored
[serialization] Yet Another Misuse of ArrayRef (#5216)
I wonder if we can assert that the lifetime is valid or something. rdar://problem/28699599
1 parent 299b47c commit 5d3a7f7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/Serialization/ModuleFile.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,8 +1119,9 @@ Status ModuleFile::associateWithFileContext(FileUnit *file,
11191119
auto scopeID = ctx.getIdentifier(scopePath);
11201120
assert(!scopeID.empty() &&
11211121
"invalid decl name (non-top-level decls not supported)");
1122-
auto path = Module::AccessPathTy({scopeID, SourceLoc()});
1123-
dependency.Import = { ctx.AllocateCopy(path), module };
1122+
std::pair<Identifier, SourceLoc> accessPathElem(scopeID, SourceLoc());
1123+
dependency.Import = {ctx.AllocateCopy(llvm::makeArrayRef(accessPathElem)),
1124+
module};
11241125
}
11251126
}
11261127

0 commit comments

Comments
 (0)