Page MenuHomePhabricator

[clangd] Fix hover crash on broken code
ClosedPublic

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

Diff Detail

Event Timeline

kadircet created this revision.Mon, May 3, 12:14 AM
kadircet requested review of this revision.Mon, May 3, 12:14 AM
hokein accepted this revision.Mon, May 3, 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.Mon, May 3, 1:01 PM
kadircet updated this revision to Diff 342671.Tue, May 4, 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.Tue, May 4, 2:46 AM
This revision was automatically updated to reflect the committed changes.