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:
Zhongxing Xu 2009-11-10 03:27:00 +00:00
parent 0b8ea554e5
commit 77c470e8c7
1 changed files with 1 additions and 1 deletions

View File

@ -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. "