mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
don't load raw comments for invalid serialized ranges
This commit is contained in:
@@ -154,7 +154,9 @@ RawComment Decl::getRawComment(bool SerializedOK) const {
|
||||
if (!CachedLocs->DocRanges.empty()) {
|
||||
SmallVector<SingleRawComment, 4> SRCs;
|
||||
for (const auto &Range : CachedLocs->DocRanges) {
|
||||
SRCs.push_back({ Range, Context.SourceMgr });
|
||||
if (Range.isValid()) {
|
||||
SRCs.push_back({ Range, Context.SourceMgr });
|
||||
}
|
||||
}
|
||||
auto RC = RawComment(Context.AllocateCopy(llvm::makeArrayRef(SRCs)));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user