[PATCH] D134137: [clangd] Return earlier when snippet is empty

Tom Praschan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 20 13:51:53 PDT 2022


tom-anders added inline comments.


================
Comment at: clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp:1017
 
+TEST(CompletionTests, EmptySnippetDoesNotCrash) {
+    // See https://github.com/clangd/clangd/issues/1216
----------------
nridge wrote:
> tom-anders wrote:
> > tom-anders wrote:
> > > kadircet wrote:
> > > > tom-anders wrote:
> > > > > nridge wrote:
> > > > > > Does this test trigger the crash for you when run without the fix?
> > > > > Yes it does, I double checked. Not sure why it didn't work for you
> > > > it doesn't trigger the crash for me either.
> > > Huh, maybe this is a b
> > Hmm could be a build type thing? I ran the tests for a Debug build, maybe it's different in Release?
> > 
> > Maybe we could also ask the author of the GitHub issue to check if it fixes the crash for them?
> Ok, I verified that the test case does produce completion proposals with empty snippets, i.e. it does trigger the problematic code path, it just happens not to crash for me. I think that's fine.
> 
> Thank you for tracking this down and fixing!
np, thanks for the review :)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134137/new/

https://reviews.llvm.org/D134137



More information about the cfe-commits mailing list