diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-11-10 03:27:00 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-11-10 03:27:00 +0000 |
commit | 572ea2697dc6fe972580779f1f69e5a987f206c9 (patch) | |
tree | a0dcab4f87d0bb8b08e2acabf9471272cb6ebb19 /lib/Analysis/CheckSizeofPointer.cpp | |
parent | ad26b7376b6fd71d14b9b893eaa1ba79e029c830 (diff) |
Use the source range of the whole sizeof expression, otherwise it crashes when
the argument is not an expression.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86660 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CheckSizeofPointer.cpp')
-rw-r--r-- | lib/Analysis/CheckSizeofPointer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Analysis/CheckSizeofPointer.cpp b/lib/Analysis/CheckSizeofPointer.cpp index 02393111e3..80a2a18c08 100644 --- a/lib/Analysis/CheckSizeofPointer.cpp +++ b/lib/Analysis/CheckSizeofPointer.cpp @@ -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. " |