diff options
author | Anna Zaks <ganna@apple.com> | 2011-12-06 23:12:27 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2011-12-06 23:12:27 +0000 |
commit | c25efccc8b448341f1aa124bb6fcc37a72dc0a46 (patch) | |
tree | 6970913705d29c650913f8730007d96f4f5105b2 /clang/test/Analysis | |
parent | 8629c0a4d07f2247ca151174bbdb8f0efc778fab (diff) | |
download | bcm5719-llvm-c25efccc8b448341f1aa124bb6fcc37a72dc0a46.tar.gz bcm5719-llvm-c25efccc8b448341f1aa124bb6fcc37a72dc0a46.zip |
[analyzer] Propagate taint through NonLoc to NonLoc casts.
- Created a new SymExpr type - SymbolCast.
- SymbolCast is created when we don't know how to simplify a NonLoc to
NonLoc casts.
- A bit of code refactoring: introduced dispatchCast to have better
code reuse, remove a goto.
- Updated the test case to showcase the new taint flow.
llvm-svn: 145985
Diffstat (limited to 'clang/test/Analysis')
-rw-r--r-- | clang/test/Analysis/taint-tester.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/Analysis/taint-tester.c b/clang/test/Analysis/taint-tester.c index b424d5d5b04..eb05f577d1b 100644 --- a/clang/test/Analysis/taint-tester.c +++ b/clang/test/Analysis/taint-tester.c @@ -12,4 +12,12 @@ void bufferScanfAssignment(int x) { scanf("%d", &n); addr += n;// expected-warning {{tainted}} *addr = n; // expected-warning 2 {{tainted}} + + double tdiv = n / 30; // expected-warning 3 {{tainted}} + char *loc_cast = (char *) n; // expected-warning {{tainted}} + char tinc = tdiv++; // expected-warning {{tainted}} + int tincdec = (char)tinc--; // expected-warning 2 {{tainted}} + int tprtarithmetic1 = *(addr+1); + + } |