[PATCH] D83189: [clangd] More complete fix for hover crashes on invalid record.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 6 12:53:47 PDT 2020


hokein added inline comments.


================
Comment at: clang-tools-extra/clangd/Hover.cpp:677
         HI.Size = Size->getQuantity();
-      if (!FD->isInvalidDecl())
         HI.Offset = Ctx.getFieldOffset(FD) / 8;
+      }
----------------
kadircet wrote:
> could you move this out of the if statement.
I'm not sure  whether Size and Offset should be be independent, IIUC your fix seems to change it as a side effect, this just preserves the old behavior. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83189





More information about the cfe-commits mailing list