[cfe-commits] r133150 - /cfe/trunk/lib/StaticAnalyzer/Checkers/CStringChecker.cpp

Jordy Rose jediknil at belkadan.com
Wed Jun 15 22:56:50 PDT 2011


Author: jrose
Date: Thu Jun 16 00:56:50 2011
New Revision: 133150

URL: http://llvm.org/viewvc/llvm-project?rev=133150&view=rev
Log:
[analyzer] Fix trivial errors in previous commit.

I will not commit without building first.
I will not commit without building first.
I will not commit without building first...

Modified:
    cfe/trunk/lib/StaticAnalyzer/Checkers/CStringChecker.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/CStringChecker.cpp?rev=133150&r1=133149&r2=133150&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/CStringChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/CStringChecker.cpp Thu Jun 16 00:56:50 2011
@@ -374,7 +374,7 @@
   state = stateFalse;
 
   // Which value comes first?
-  QualType cmpTy = svalBuilder.getComparisonType();
+  QualType cmpTy = svalBuilder.getConditionType();
   SVal reverse = svalBuilder.evalBinOpLL(state, BO_GT,
                                          *firstLoc, *secondLoc, cmpTy);
   DefinedOrUnknownSVal *reverseTest = dyn_cast<DefinedOrUnknownSVal>(&reverse);
@@ -407,6 +407,7 @@
 
   // Convert the first buffer's start address to char*.
   // Bail out if the cast fails.
+  ASTContext &Ctx = svalBuilder.getContext();
   QualType CharPtrTy = Ctx.getPointerType(Ctx.CharTy);
   SVal FirstStart = svalBuilder.evalCast(*firstLoc, CharPtrTy, 
                                          First->getType());
@@ -1036,7 +1037,7 @@
   // If the check is for strnlen() then bind the return value to no more than
   // the maxlen value.
   if (IsStrnlen) {
-    QualType cmpTy = C.getSValBuilder().getComparisonType();
+    QualType cmpTy = C.getSValBuilder().getConditionType();
 
     // It's a little unfortunate to be getting this again,
     // but it's not that expensive...





More information about the cfe-commits mailing list