Skip to content

Commit 580e618

Browse files
authored
Merge pull request #68778 from ahoppen/ahoppen/relax-assertion
[ASTGen] Relax assertion on `BridgedSourceLoc` initializer
2 parents 8577c6b + 8dec9ad commit 580e618

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/ASTGen/Sources/ASTGen/Bridge.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ extension BridgedSourceLoc {
2020
at position: AbsolutePosition,
2121
in buffer: UnsafeBufferPointer<UInt8>
2222
) {
23-
precondition(position.utf8Offset >= 0 && position.utf8Offset < buffer.count)
23+
precondition(position.utf8Offset >= 0 && position.utf8Offset <= buffer.count)
2424
self = SourceLoc_advanced(BridgedSourceLoc(raw: buffer.baseAddress!), SwiftInt(position.utf8Offset))
2525
}
2626
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// RUN: %sourcekitd-test -req=cursor -pos=3:37 %s -- %s
2+
@freestanding(expression)
3+
macro powerAssert() = #externalMacro

0 commit comments

Comments
 (0)