Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/Parse/ParseDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1506,7 +1506,7 @@ bool Parser::parseExternAttribute(DeclAttributes &Attributes,
return false;
}

auto AttrRange = SourceRange(Loc, Tok.getLoc());
auto AttrRange = SourceRange(Loc, rParenLoc);

// Reject duplicate attributes with the same kind.
if (ExternAttr::find(Attributes, kind)) {
Expand Down Expand Up @@ -2329,7 +2329,7 @@ bool Parser::parseBackDeployedAttribute(DeclAttributes &Attributes,
}

assert(!PlatformAndVersions.empty());
auto AttrRange = SourceRange(Loc, Tok.getLoc());
auto AttrRange = SourceRange(Loc, RightLoc);
for (auto &Item : PlatformAndVersions) {
Attributes.add(new (Context) BackDeployedAttr(AtLoc, AttrRange, Item.first,
Item.second,
Expand Down
10 changes: 10 additions & 0 deletions test/SourceKit/Misc/rdar123405070.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: %sourcekitd-test -req=open %s -- %s
// Test that this doesn't crash sourcekitd

@_backDeploy(before: macOS 14.0)
@inline(never)
public func foo() {}

@_extern(wasm, module: "b", name: "c")
@_extern(c)
private func bar()