[analyzer] Pass the correct loc Expr from VisitIncDecOp to evalStore
authorRafael Stahl <r.stahl@tum.de>
Mon, 7 Jan 2019 15:07:01 +0000 (15:07 +0000)
committerRafael Stahl <r.stahl@tum.de>
Mon, 7 Jan 2019 15:07:01 +0000 (15:07 +0000)
commitcc19f921b5797446943d040884981eb4b82c4a3e
tree1000bd3797c551dccdf41efb784a91d05cffed32
parent9b6dfac5ad6a80766234203c23d26b5cff15711b
[analyzer] Pass the correct loc Expr from VisitIncDecOp to evalStore

Summary: The LocationE parameter of evalStore is documented as "The location expression that is stored to". When storing from an increment / decrement operator this was not satisfied. In user code this causes an inconsistency between the SVal and Stmt parameters of checkLocation.

Reviewers: NoQ, dcoughlin, george.karpenkov

Reviewed By: NoQ

Subscribers: xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, cfe-commits

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

llvm-svn: 350528
clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp
clang/unittests/StaticAnalyzer/RegisterCustomCheckersTest.cpp