Similar to D146426
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
190 ms | x64 debian > Clangd Unit Tests._/ClangdTests/9::37 |
Event Timeline
I am aware that this null checking at leaves are not considered a sustainable solution and I agree with the sentiment there. But we're seeing an increasing number of crashes in production on invalid code recently. Happy to take a different course if there are alternatives, but as also explained in D146426, the situation around parameter lists having nullptrs seem to be the state for a long time now, e.g:
template <typename T> auto x = [](__fp16) {}; decltype(x<int>);
is a reproducer that crashes even clang-12 due to a nullptr in the paremeter list. Surely it'd be better to fix this invariant, but I am afraid we don't know how to do that immediately and considering people have been dealing with this situation by adding null checks into the places that triggered crashes ever since, I'd like to move forward with this fix until someone can figure out the situation.
IMO, if the increasing number of crashes is a concern, now is the time to fix it properly instead of continuing to play whack-a-mole. To me, "fix it properly" means ensuring that we don't have null AST nodes, but if during investigation there's a more foundational problem that prevents us from doing that, we can make a different decision once we have more information.
Hopefully this should be addressed by D146971, but it would be great to get a reproducer for this issue to be certain.