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

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 6 12:54:08 PDT 2020


kadircet 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;
+      }
----------------
hokein wrote:
> 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. 
it wasn't a side effect, it was intentional and stamped (and explicitly spelled out in the description)


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