We should not call getFieldOffset on invalid record decls.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
thanks for doing this !
clang-tools-extra/clangd/Hover.cpp | ||
---|---|---|
667 | i think we should bail out for invalid decls in here too. it won't crash but will provide spurious results. so i think an early exit for ND.isInvalidDecl() at the beginning of the function would be nice. | |
679–680 | could you move this out of the if statement. |
address comment.
clang-tools-extra/clangd/Hover.cpp | ||
---|---|---|
679–680 | 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. |
clang-tools-extra/clangd/Hover.cpp | ||
---|---|---|
679–680 | it wasn't a side effect, it was intentional and stamped (and explicitly spelled out in the description) |
clang-tools-extra/clangd/Hover.cpp | ||
---|---|---|
679–680 | ah, OK, changed it back. |
i think we should bail out for invalid decls in here too. it won't crash but will provide spurious results. so i think an early exit for ND.isInvalidDecl() at the beginning of the function would be nice.