diff options
author | Pavel Labath <labath@google.com> | 2013-08-23 07:19:22 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2013-08-23 07:19:22 +0000 |
commit | 02b64d46a0ab8da426dadb1873ead648c8ef70e6 (patch) | |
tree | 3d72dea09b68628b42ae0c3c255e575fb181c26d /clang/test/Analysis/logical-ops.c | |
parent | a9debbfb01140fb0c0bd49bb8f4c119ad93c3aa6 (diff) | |
download | bcm5719-llvm-02b64d46a0ab8da426dadb1873ead648c8ef70e6.tar.gz bcm5719-llvm-02b64d46a0ab8da426dadb1873ead648c8ef70e6.zip |
[analyzer] Refactor conditional expression evaluating code
Summary:
Instead of digging through the ExplodedGraph, to figure out which edge brought
us here, I compute the value of conditional expression by looking at the
sub-expression values.
To do this, I needed to change the liveness algorithm a bit -- now, the full
conditional expression also depends on all atomic sub-expressions, not only the
outermost ones.
Reviewers: jordan_rose
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1340
llvm-svn: 189090
Diffstat (limited to 'clang/test/Analysis/logical-ops.c')
-rw-r--r-- | clang/test/Analysis/logical-ops.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/Analysis/logical-ops.c b/clang/test/Analysis/logical-ops.c index a1223b39fa8..afaa2f10778 100644 --- a/clang/test/Analysis/logical-ops.c +++ b/clang/test/Analysis/logical-ops.c @@ -25,3 +25,15 @@ int testTypeIsInt(int i, void *p) { return 1; return 0; } + +// These crashed the analyzer at some point. +int between(char *x) { + extern char start[]; + extern char end[]; + return x >= start && x < end; +} + +int undef(void) {} // expected-warning{{control reaches end of non-void function}} +void useUndef(void) { 0 || undef(); } + +void testPointer(void) { (void) (1 && testPointer && 0); } |