mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[refactoring] fix RangeInfo crash inside comment, due to unhandled invalid CharSourceRange.
Resolves rdar://problem/38550117
This commit is contained in:
@@ -1513,9 +1513,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