From 572ea2697dc6fe972580779f1f69e5a987f206c9 Mon Sep 17 00:00:00 2001 From: Zhongxing Xu Date: Tue, 10 Nov 2009 03:27:00 +0000 Subject: [PATCH] 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 --- lib/Analysis/CheckSizeofPointer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. " -- 2.40.0