mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #15301 from nathawes/rdar38550117-range-info-on-comment-mark-crashing
[refactoring] fix RangeInfo crash inside comment, due to unhandled invalid CharSourceRange
This commit is contained in:
@@ -1516,9 +1516,16 @@ static void resolveRange(SwiftLangSupport &Lang,
|
||||
|
||||
CompilerInvocation CompInvok;
|
||||
ASTInvok->applyTo(CompInvok);
|
||||
|
||||
RangeInfo Result;
|
||||
Result.RangeKind = Lang.getUIDForRangeKind(Info.Kind);
|
||||
Result.RangeContent = Info.ContentRange.str();
|
||||
if (Info.Kind == RangeKind::Invalid) {
|
||||
Result.RangeContent = "";
|
||||
} else {
|
||||
assert(Info.ContentRange.isValid());
|
||||
Result.RangeContent = Info.ContentRange.str();
|
||||
}
|
||||
|
||||
switch (Info.Kind) {
|
||||
case RangeKind::SingleExpression: {
|
||||
SmallString<64> SS;
|
||||
|
||||
Reference in New Issue
Block a user