forked from OSchip/llvm-project
Use the source range of the whole sizeof expression, otherwise it crashes when
the argument is not an expression. llvm-svn: 86660
This commit is contained in:
parent
0b8ea554e5
commit
77c470e8c7
|
@ -44,7 +44,7 @@ void WalkAST::VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *E) {
|
|||
|
||||
QualType T = E->getTypeOfArgument();
|
||||
if (T->isPointerType()) {
|
||||
SourceRange R = E->getArgumentExpr()->getSourceRange();
|
||||
SourceRange R = E->getSourceRange();
|
||||
BR.EmitBasicReport("Potential unintended use of sizeof() on pointer type",
|
||||
"Logic",
|
||||
"The code calls sizeof() on a pointer type. "
|
||||
|
|
Loading…
Reference in New Issue