[analyzer] MisusedMovedObjectChecker: Fix false positive on state-resetting, handling...
authorPeter Szecsi <szepet95@gmail.com>
Sat, 28 Oct 2017 23:09:37 +0000 (23:09 +0000)
committerPeter Szecsi <szepet95@gmail.com>
Sat, 28 Oct 2017 23:09:37 +0000 (23:09 +0000)
commit65f8f83a7497186118cda9813b395f7848122e0d
tree5521a56e57ccb01f70c23eaa075a3e0e6a6afb2e
parentda42135cef4786bde7d3ecd082ca292b90ca1fb3
[analyzer] MisusedMovedObjectChecker: Fix false positive on state-resetting, handling method calls on base-class sub-objects

An earlier solution from Artem r315301 solves the reset problem, however, the
reports should be handled the same way in case of method calls. We should not
just report the base class of the object where the method was defined but the
whole object.

Fixed false positive which came from not removing the subobjects in case of a
state-resetting function. (Just replaced the State->remove(...) call to
removeFromState(..) which was defined exactly for that purpose.)

Some minor typos fixed in this patch as well which did not worth a whole new
patch in my opinion, so included them here.

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

llvm-svn: 316850
clang/lib/StaticAnalyzer/Checkers/MisusedMovedObjectChecker.cpp
clang/test/Analysis/MisusedMovedObject.cpp