This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Fix hover crash on broken code
ClosedPublic

Authored by kadircet on May 3 2021, 12:14 AM.

Diff Detail

Event Timeline

kadircet created this revision.May 3 2021, 12:14 AM
kadircet requested review of this revision.May 3 2021, 12:14 AM
hokein accepted this revision.May 3 2021, 1:01 PM
hokein added inline comments.
clang-tools-extra/clangd/unittests/HoverTests.cpp
2447

IIUC, x refers to an undefined variable right? might be renamed it to undefine.

Instead of creating a new test, maybe add this no-crash test to TEST(Hover, NoHover) {, looks like a good fit there.

This revision is now accepted and ready to land.May 3 2021, 1:01 PM
kadircet updated this revision to Diff 342671.May 4 2021, 1:56 AM
  • s/x/undefined
clang-tools-extra/clangd/unittests/HoverTests.cpp
2447

IIUC, x refers to an undefined variable right? might be renamed it to undefine.

Done.

Instead of creating a new test, maybe add this no-crash test to TEST(Hover, NoHover) {, looks like a good fit there.

This produces a hover though. I think we should collect all the cases about crash-ness here, independent of whether they produce a hover or not.

This revision was landed with ongoing or failed builds.May 4 2021, 2:46 AM
This revision was automatically updated to reflect the committed changes.