This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Fix a semantic-highlighting crash.
ClosedPublic

Authored by hokein on Oct 31 2022, 2:08 AM.

Diff Detail

Event Timeline

hokein created this revision.Oct 31 2022, 2:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 31 2022, 2:08 AM
Herald added a subscriber: arphaman. · View Herald Transcript
hokein requested review of this revision.Oct 31 2022, 2:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 31 2022, 2:08 AM
kadircet accepted this revision.Oct 31 2022, 2:49 AM

thanks!

clang-tools-extra/clangd/SemanticHighlighting.cpp
664–666

can you add a comment here saying getMethodDecl can return nullptr with member pointers.

(it's also quite surprising that this is the only place we're calling getMethodDecl in clangd, afaict).

664–666

nit: isa_and_present is the new alternative

This revision is now accepted and ready to land.Oct 31 2022, 2:49 AM
This revision was automatically updated to reflect the committed changes.
hokein marked 2 inline comments as done.