]> granicus.if.org Git - clang/commit
[analyzer] Improve the modeling of memset().
authorHenry Wong <movietravelcode@outlook.com>
Wed, 16 May 2018 12:37:53 +0000 (12:37 +0000)
committerHenry Wong <movietravelcode@outlook.com>
Wed, 16 May 2018 12:37:53 +0000 (12:37 +0000)
commite1ae43bfd823ca8bd482d40ee02aff0aa9c9c25f
tree8513b2832985bb9b599cec2873c6df950266480b
parentbfc7cfab82c332ec0070bf8cfb2c24359bef640d
[analyzer] Improve the modeling of memset().

Since there is no perfect way bind the non-zero value with the default binding, this patch only considers the case where buffer's offset is zero and the char value is 0. And according to the value for overwriting, decide how to update the string length.

Reviewers: dcoughlin, NoQ, xazax.hun, a.sidorin, george.karpenkov

Reviewed By: NoQ

Differential Revision: https://reviews.llvm.org/D44934

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332463 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Checkers/CStringChecker.cpp
test/Analysis/bstring.cpp
test/Analysis/null-deref-ps-region.c
test/Analysis/string.c