[cfe-commits] r150306 - in /cfe/trunk: lib/StaticAnalyzer/Checkers/BoolAssignmentChecker.cpp lib/StaticAnalyzer/Checkers/CMakeLists.txt lib/StaticAnalyzer/Checkers/Checkers.td test/Analysis/bool-assignment.cpp test/Analysis/bool-assignment2.c

Ryan Govostes rzg at apple.com
Mon Feb 20 01:44:01 PST 2012


On Feb 17, 2012, at 1:11 AM, Jordy Rose <jediknil at belkadan.com> wrote:

> Nice idea for a checker. The one thing I'm wondering is why you decided to use this less than / greater than approach...it might not matter here, but in general statements about equality and inequality are a bit easier for the analyzer to reason about than less than and greater than. It requires the same number of checks, too:

Hi Jordy,

Thanks. This is my first checker and the patch I submitted is the result of a few iterations with Ted. Indeed I originally wrote it using equality and inequality as you suggested, but Ted recommended the approach used now:

> [...] I can say that you are definitely going into territory where the current solver isn't going to handle this well.  It currently doesn't reason about arbitrary disjunctions.  We currently accomplish that feat in the static analyzer by bifurcating states.

So, we settled on (x <= 1) && (x >= 0) as you see in the patch.

Best,
Ryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120220/74b33155/attachment.html>


More information about the cfe-commits mailing list