aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2013-02-27 18:49:57 +0000
committerJordan Rose <jordan_rose@apple.com>2013-02-27 18:49:57 +0000
commit6f4160828db75f36b22a204da202723c592644f3 (patch)
treeced61048fff2011df88a073d54aec11a2f109780 /unittests/Format/FormatTest.cpp
parenta11f22f60673c6c9556976b49e64bf7fa751f4eb (diff)
[analyzer] Teach FindLastStoreBRVisitor to understand stores of the same value.
Consider this case: int *p = 0; p = getPointerThatMayBeNull(); *p = 1; If we inline 'getPointerThatMayBeNull', we might know that the value of 'p' is NULL, and thus emit a null pointer dereference report. However, we usually want to suppress such warnings as error paths, and we do so by using FindLastStoreBRVisitor to see where the NULL came from. In this case, though, because 'p' was NULL both before and after the assignment, the visitor would decide that the "last store" was the initialization, not the re-assignment. This commit changes FindLastStoreBRVisitor to consider all PostStore nodes that assign to this region. This still won't catches changes made directly by checkers if they re-assign the same value, but it does handle the common case in user-written code and will trigger ReturnVisitor's suppression machinery as expected. <rdar://problem/13299738> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176201 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
0 files changed, 0 insertions, 0 deletions