When a semantic checking fails on a syntactic InitListExpr, we will
get an ill-formed semantic InitListExpr (e.g. some inits are nullptr),
using this semantic InitListExpr in clang (without setting the err-bits) is crashy.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/Sema/SemaInit.cpp | ||
---|---|---|
965 | Can we have a clang test for this? If nothing else, an AST-dump test should be able to capture this, right? If we can turn it into a real clang crash, we may be able to get this on the release branch. |
clang/include/clang/AST/Expr.h | ||
---|---|---|
4697 | Hmm, actually hardcoding the error->VI relationship seems like a smell here... |
clang/include/clang/AST/Expr.h | ||
---|---|---|
4697 | yeah, this is duplicated with the one in computeDependence(RecoveryExpr). ideas:
any preference? personally, I'd prefer 2. | |
clang/lib/Sema/SemaInit.cpp | ||
965 | I tried it, but no luck to get such testcase :( ast-dump doesn't really help, it just dumps the syntactic form, not the semantic form. another option will be to write an unittest in AST, implementing a RAV to retrieve the semantic form of the ini-list-expr, and check the error-bit. |
Hmm, actually hardcoding the error->VI relationship seems like a smell here...
I'm not sure what the best fix is though, any ideas?