Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Could you provide more information about why these null checks are needed in this case?
Well the fact it was crashing without those null checks was the reason they were added. I'm not 100% sure of the root cause and this could just be a case of applying a plaster to a broken arm. I'm guessing the root cause of the crash is the fact the callee is a CXXMethodDecl which is not being handled but I honestly don't know.
Right -- what I meant is a more detailed description of why, for example, tryGetCallExprAncestorForCxxConstructExpr can't find the CallExpr in this case -- is it not there, or does it not have the expected shape, or something else? What does the AST look like?
I'm worried about adding defensive checks because they can make code more difficult to fix in future.
To be honest the whole fix that caused the crash in the first place was a mess, I have decided to fix this by checking if the parent is a temporary expr bound to an r value, as well as removing the hacky looking code from the previous patch.