This is an archive of the discontinued LLVM Phabricator instance.

[clangd][Hover] Dont crash on null types
ClosedPublic

Authored by kadircet on Jun 27 2020, 2:13 AM.

Diff Detail

Event Timeline

kadircet created this revision.Jun 27 2020, 2:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 27 2020, 2:13 AM
hokein accepted this revision.Jun 28 2020, 11:28 PM

Thanks, I was going to prepare a patch this morning, then realized this one.

clang-tools-extra/clangd/Hover.cpp
302

nit: now we can remove this if-else branch.

clang-tools-extra/clangd/unittests/HoverTests.cpp
716

I think auto [x, y] = 1 should be enough to reproduce the crash.

This revision is now accepted and ready to land.Jun 28 2020, 11:28 PM
kadircet marked 4 inline comments as done.Jun 29 2020, 12:09 AM
kadircet added inline comments.
clang-tools-extra/clangd/Hover.cpp
302

well, I wasn't sure what we were logging for :/

but I think you are right, it seems hard to find in the best case.

clang-tools-extra/clangd/unittests/HoverTests.cpp
716

i could swear this was not crashing the first time i checked :P

kadircet updated this revision to Diff 274000.Jun 29 2020, 12:09 AM
kadircet marked 2 inline comments as done.

address comments

This revision was automatically updated to reflect the committed changes.