Skip to content

Commit 97ddb6f

Browse files
author
David Ungar
committed
---
yaml --- r: 326299 b: refs/heads/master-next c: 5d87a66 h: refs/heads/master i: 326297: 6cc6d4d 326295: 2fd8e11
1 parent 303b8e5 commit 97ddb6f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: e052da7d8886fa0439677852e8f7830b20c2e1da
3-
refs/heads/master-next: 3c891f95320e780defbac0c86bba3ad595b3ce0b
3+
refs/heads/master-next: 5d87a66edae4b54dbe1853e56614e636f33e0129
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
66
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-b: 66d897bfcf64a82cb9a87f5e663d889189d06d07

branches/master-next/lib/AST/ASTScopeSourceRange.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,12 @@ SourceRange GenericTypeOrExtensionWholePortion::getChildlessSourceRangeOf(
309309

310310
SourceRange
311311
ExtensionScope::moveStartPastExtendedNominal(const SourceRange sr) const {
312-
return SourceRange(getLocAfterExtendedNominal(decl), sr.End);
312+
const auto start = getLocAfterExtendedNominal(decl);
313+
// Illegal code can have an endLoc that is before the end of the
314+
// ExtendedNominal, so push the end back, too, in that case.
315+
const auto end =
316+
getSourceManager().isBeforeInBuffer(sr.End, start) ? start : sr.End;
317+
return SourceRange(start, end);
313318
}
314319

315320
SourceRange

0 commit comments

Comments
 (0)