This patch adds nullptr checks for LHSBuiltinTy and RHSBuiltinTy before using them to getBuiltinVectorTypeInfo() in clang::Sema::CheckSizelessVectorOperands(clang::ActionResult<clang::Expr *, true> &, clang::ActionResult<clang::Expr *, true> &, clang::SourceLocation, bool, clang::Sema::ArithConvKind).
Details
Diff Detail
Event Timeline
| clang/lib/Sema/SemaExpr.cpp | ||
|---|---|---|
| 11119 | This doesn't seem like a non-functional change. Here it checks that LHSBuiltinTy is not nullptr before using it, which suggests that it is valid for LHSType/RHSType not to be a builtin type. There is also nothing else guarding that the types are all VLSTBuiltinTypes. Do none of the tests fail? | |
| clang/lib/Sema/SemaExpr.cpp | ||
|---|---|---|
| 11149 | Thanks for the comments. I have added nullptr checks for LHSBuiltinTy and RHSBuiltinTy before using them to getBuiltinVectorTypeInfo() which dereferences. | |
| clang/lib/Sema/SemaExpr.cpp | ||
|---|---|---|
| 11148 | I think this is unnecessary. isVLSTBuiltinType only returns true if LHSType is a BuiltinType already (or at least, a subset-of). See : https://clang.llvm.org/doxygen/Type_8cpp_source.html#l02409 | |
| clang/lib/Sema/SemaExpr.cpp | ||
|---|---|---|
| 11148 | This makes sense to me. Thank you for the pointer and explanation! | |
This doesn't seem like a non-functional change. Here it checks that LHSBuiltinTy is not nullptr before using it, which suggests that it is valid for LHSType/RHSType not to be a builtin type. There is also nothing else guarding that the types are all VLSTBuiltinTypes. Do none of the tests fail?