Skip to content

Commit 10b3ed3

Browse files
authored
Merge pull request #77117 from bnbarham/copy-usr
[CursorInfo] Take a copy of `USR` when resolving cursor info
2 parents 49499d0 + 6b3cc32 commit 10b3ed3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/SourceKit/lib/SwiftLang/SwiftSourceDocInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2335,7 +2335,7 @@ static void resolveCursorFromUSR(
23352335

23362336
class CursorInfoConsumer : public SwiftASTConsumer {
23372337
std::string InputFile;
2338-
StringRef USR;
2338+
std::string USR;
23392339
SwiftLangSupport ⟪
23402340
SwiftInvocationRef ASTInvok;
23412341
const bool TryExistingAST;
@@ -2376,7 +2376,7 @@ static void resolveCursorFromUSR(
23762376
void handlePrimaryAST(ASTUnitRef AstUnit) override {
23772377
auto &CompIns = AstUnit->getCompilerInstance();
23782378

2379-
if (USR.starts_with("c:")) {
2379+
if (StringRef(USR).starts_with("c:")) {
23802380
LOG_WARN_FUNC("lookup for C/C++/ObjC USRs not implemented");
23812381
CursorInfoData Info;
23822382
Info.InternalDiagnostic = "Lookup for C/C++/ObjC USRs not implemented.";

0 commit comments

Comments
 (0)