[cfe-commits] r86663 - /cfe/trunk/lib/Analysis/CheckSizeofPointer.cpp

Zhongxing Xu xuzhongxing at gmail.com
Mon Nov 9 20:22:09 PST 2009


Author: zhongxingxu
Date: Mon Nov  9 22:22:08 2009
New Revision: 86663

URL: http://llvm.org/viewvc/llvm-project?rev=86663&view=rev
Log:
Now we can safely use the argument expression's source range.

Modified:
    cfe/trunk/lib/Analysis/CheckSizeofPointer.cpp

Modified: cfe/trunk/lib/Analysis/CheckSizeofPointer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CheckSizeofPointer.cpp?rev=86663&r1=86662&r2=86663&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/CheckSizeofPointer.cpp (original)
+++ cfe/trunk/lib/Analysis/CheckSizeofPointer.cpp Mon Nov  9 22:22:08 2009
@@ -49,7 +49,7 @@
 
   QualType T = E->getTypeOfArgument();
   if (T->isPointerType()) {
-    SourceRange R = E->getSourceRange();
+    SourceRange R = E->getArgumentExpr()->getSourceRange();
     BR.EmitBasicReport("Potential unintended use of sizeof() on pointer type",
                        "Logic",
                        "The code calls sizeof() on a pointer type. "





More information about the cfe-commits mailing list