]> granicus.if.org Git - clang/commitdiff
[analyzer] Fix trivial errors in previous commit.
authorJordy Rose <jediknil@belkadan.com>
Thu, 16 Jun 2011 05:56:50 +0000 (05:56 +0000)
committerJordy Rose <jediknil@belkadan.com>
Thu, 16 Jun 2011 05:56:50 +0000 (05:56 +0000)
I will not commit without building first.
I will not commit without building first.
I will not commit without building first...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133150 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Checkers/CStringChecker.cpp

index a19ccdec0b79ffeb493680ded067d0d80807ce3a..2ea6e0643b69dc4198972081408973b911789397 100644 (file)
@@ -374,7 +374,7 @@ const GRState *CStringChecker::CheckOverlap(CheckerContext &C,
   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 @@ const GRState *CStringChecker::CheckOverlap(CheckerContext &C,
 
   // 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 @@ void CStringChecker::evalstrLengthCommon(CheckerContext &C, const CallExpr *CE,
   // 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...