Skip to content

Commit 9132d18

Browse files
authored
Merge pull request #68969 from ahoppen/ahoppen/5.10/relax-assertion
[5.10][ASTGen] Relax assertion on `BridgedSourceLoc` initializer
2 parents d649598 + 67fc2ca commit 9132d18

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/ASTGen/Sources/ASTGen/Misc.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ extension BridgedSourceLoc {
6565
in buffer: UnsafeBufferPointer<UInt8>
6666
) {
6767
if let start = buffer.baseAddress,
68-
position.utf8Offset >= 0 && position.utf8Offset < buffer.count {
68+
position.utf8Offset >= 0 && position.utf8Offset <= buffer.count {
6969
self = SourceLoc_advanced(BridgedSourceLoc(raw: start), SwiftInt(position.utf8Offset))
7070
} else {
7171
self = nil
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)