File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,10 @@ concept HasSourceRangeOnly = requires(T e) {
40
40
&&(!HasStartAndEndLoc<T>)&&(!HasOneLoc<T>);
41
41
42
42
swift::SourceRange getSourceRange (const HasStartAndEndLoc auto & locatable) {
43
- return {locatable.getStartLoc (), locatable.getEndLoc ()};
43
+ if (locatable.getStartLoc () && locatable.getEndLoc ()) {
44
+ return {locatable.getStartLoc (), locatable.getEndLoc ()};
45
+ }
46
+ return {};
44
47
}
45
48
46
49
swift::SourceRange getSourceRange (const HasOneLoc auto & locatable) {
@@ -64,7 +67,10 @@ swift::SourceRange getSourceRange(const llvm::MutableArrayRef<Locatable>& locata
64
67
}
65
68
auto startRange = getSourceRange (locatables.front ());
66
69
auto endRange = getSourceRange (locatables.back ());
67
- return {startRange.Start , endRange.End };
70
+ if (startRange.Start && endRange.End ) {
71
+ return {startRange.Start , endRange.End };
72
+ }
73
+ return {};
68
74
}
69
75
} // namespace detail
70
76
You can’t perform that action at this time.
0 commit comments