diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-07-25 21:58:25 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-07-25 21:58:25 +0000 |
commit | bb81ffb342eaa647854ee0764304942884d8b873 (patch) | |
tree | 2cecf9a2da764a4a4bd4df184e1f2e8ea883c43d /clang/test/Analysis/misc-ps.c | |
parent | 1a11252f60f11e4aada3f8f39cea20275c5909d9 (diff) | |
download | bcm5719-llvm-bb81ffb342eaa647854ee0764304942884d8b873.tar.gz bcm5719-llvm-bb81ffb342eaa647854ee0764304942884d8b873.zip |
Update ExprEngine's handling of ternary operators to find the ternary expression
value by scanning the path, rather than assuming we have visited the '?:' operator
as a terminator (which sets a value indicating which expression to grab the
final ternary expression value from).
llvm-svn: 160760
Diffstat (limited to 'clang/test/Analysis/misc-ps.c')
-rw-r--r-- | clang/test/Analysis/misc-ps.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/Analysis/misc-ps.c b/clang/test/Analysis/misc-ps.c index f81b0ddc68d..8ff710b12f5 100644 --- a/clang/test/Analysis/misc-ps.c +++ b/clang/test/Analysis/misc-ps.c @@ -126,3 +126,10 @@ void rdar10686586() { } } +// This example tests CFG handling of '||' nested in a ternary expression, +// and seeing that the analyzer doesn't crash. +int isctype(char c, unsigned long f) +{ + return (c < 1 || c > 10) ? 0 : !!(c & f); +} + |