diff options
Diffstat (limited to 'clang/test/Analysis/misc-ps.m')
-rw-r--r-- | clang/test/Analysis/misc-ps.m | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/Analysis/misc-ps.m b/clang/test/Analysis/misc-ps.m index 777784aabcb..ec0e95a465d 100644 --- a/clang/test/Analysis/misc-ps.m +++ b/clang/test/Analysis/misc-ps.m @@ -245,3 +245,18 @@ void rdar_6777003(int x) { *p = 1; // expected-warning{{Dereference of null pointer}} } +// For pointer arithmetic, --/++ should be treated as preserving non-nullness, +// regardless of how well the underlying StoreManager reasons about pointer +// arithmetic. +// <rdar://problem/6777209> + +void rdar_6777209(char *p) { + if (p == 0) + return; + + ++p; + + // This branch should always be infeasible. + if (p == 0) + *p = 'c'; // no-warning +} |