From ee2fde12934c0b11a71db286d1dc9ee8341802a5 Mon Sep 17 00:00:00 2001 From: Jordy Rose Date: Thu, 16 Jun 2011 05:56:50 +0000 Subject: [PATCH] [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... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133150 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/StaticAnalyzer/Checkers/CStringChecker.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/StaticAnalyzer/Checkers/CStringChecker.cpp b/lib/StaticAnalyzer/Checkers/CStringChecker.cpp index a19ccdec0b..2ea6e0643b 100644 --- a/lib/StaticAnalyzer/Checkers/CStringChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/CStringChecker.cpp @@ -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(&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... -- 2.40.0