]> granicus.if.org Git - clang/commitdiff
Allow the "size" of a buffer access check to be either signed or unsigned. Fixes...
authorJordy Rose <jediknil@belkadan.com>
Mon, 16 Aug 2010 23:25:19 +0000 (23:25 +0000)
committerJordy Rose <jediknil@belkadan.com>
Mon, 16 Aug 2010 23:25:19 +0000 (23:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111205 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Checker/CStringChecker.cpp

index 0c0ccd6877da59b0c5d1c5c3fc5ddb66a6d177a3..583462a00b11c3b742498ab0b3143b0398d8fa15 100644 (file)
@@ -248,7 +248,7 @@ const GRState *CStringChecker::CheckBufferAccess(CheckerContext &C,
   SValuator &SV = VM.getSValuator();
   ASTContext &Ctx = C.getASTContext();
 
-  QualType SizeTy = Ctx.getSizeType();
+  QualType SizeTy = Size->getType();
   QualType PtrTy = Ctx.getPointerType(Ctx.CharTy);
 
   // Check that the first buffer is non-null.