This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Fix a crash for accessing a null field decl returned by findExplicitReferences.
ClosedPublic

Authored by hokein on Apr 15 2020, 12:18 AM.

Diff Detail

Event Timeline

hokein created this revision.Apr 15 2020, 12:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 15 2020, 12:18 AM
kadircet added inline comments.Apr 15 2020, 12:47 AM
clang-tools-extra/clangd/FindTarget.cpp
717

thanks for fixing this !

But I suppose we should rather return a result with empty TargetDecl as this is what API promises:

/// For dependent and unresolved references, Targets can also be empty.

hokein updated this revision to Diff 257718.Apr 15 2020, 7:56 AM

emit empty decl and simplify the testcase.

sammccall accepted this revision.Apr 15 2020, 11:20 AM
This revision is now accepted and ready to land.Apr 15 2020, 11:20 AM
This revision was automatically updated to reflect the committed changes.
hokein marked an inline comment as done.