diff options
| author | Ted Kremenek <kremenek@apple.com> | 2010-10-22 22:08:32 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2010-10-22 22:08:32 +0000 |
| commit | 5c97605c1d41eb246e40519866850a7b5f86a158 (patch) | |
| tree | 15480f2fc9e56fa451863fe503380ace6e6ded81 /clang/test/Analysis | |
| parent | 7043fba7fa41a7a544664ffaa91a5552d0e0c0c7 (diff) | |
| download | bcm5719-llvm-5c97605c1d41eb246e40519866850a7b5f86a158.tar.gz bcm5719-llvm-5c97605c1d41eb246e40519866850a7b5f86a158.zip | |
Fix a horrible bug in all dataflow analyses that use CFGRecStmtVisitor (including live variables analysis).
We shouldn't recurse into CompoundStmts since they are already inlined in the CFG. This could result in
bogus dead stores warnings (among other things).
llvm-svn: 117162
Diffstat (limited to 'clang/test/Analysis')
| -rw-r--r-- | clang/test/Analysis/dead-stores.m | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/Analysis/dead-stores.m b/clang/test/Analysis/dead-stores.m index 701e5802b25..730b8266bd1 100644 --- a/clang/test/Analysis/dead-stores.m +++ b/clang/test/Analysis/dead-stores.m @@ -41,3 +41,21 @@ void DeadStoreTest(NSObject *anObject) { void rdar_7631278(NSObject *x) { x = ((void*)0); } + +// This test case issuing a bogus warning for the declaration of 'isExec' +// because the compound statement for the @synchronized was being visited +// twice by the LiveVariables analysis. +BOOL baz_rdar8527823(); +void foo_rdar8527823(); +@interface RDar8527823 +- (void) bar_rbar8527823; +@end +@implementation RDar8527823 +- (void) bar_rbar8527823 +{ + @synchronized(self) { + BOOL isExec = baz_rdar8527823(); // no-warning + if (isExec) foo_rdar8527823(); + } +} +@end |

