[PATCH] [analyzer] Refactor conditional expression evaluating code

Pavel Labath labath at google.com
Mon Aug 12 10:49:12 PDT 2013


  Handle the case when the LHS of the logical operator is undefined

  Apparently, this can happen at least when the LHS is a pointer comparison at the
  analyzer cannot tell anything about the pointers in question.

  One could argue that it is not a good idea to make up a value for the expression
  in the environment if someone before us deliberately left it as undefined, since
  some checker may rely on this fact. However, one could also say that if somebody
  wanted to check for the undefined value, he could do it immediately after the
  expression which produced it (which all current checkers do, I believe). Also,
  fact is that the analyzer already had assumed the value to be true or false
  anyway, when it picked which branch to follow, so I am now basically recording
  that decision.

Hi jordan_rose,

http://llvm-reviews.chandlerc.com/D1340

CHANGE SINCE LAST DIFF
  http://llvm-reviews.chandlerc.com/D1340?vs=3316&id=3382#toc

Files:
  lib/Analysis/LiveVariables.cpp
  lib/StaticAnalyzer/Core/ExprEngine.cpp
  lib/StaticAnalyzer/Core/ExprEngineC.cpp
  test/Analysis/logical-ops.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1340.2.patch
Type: text/x-patch
Size: 7639 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130812/b4ff6df6/attachment.bin>


More information about the cfe-commits mailing list