summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorArtem Dergachev <artem.dergachev@gmail.com>2019-10-19 01:50:46 +0000
committerArtem Dergachev <artem.dergachev@gmail.com>2019-10-19 01:50:46 +0000
commit9504ebbcec8f25e384f36e4145c0cee135a58d88 (patch)
tree2a26e8e8d1b6fcf3e267ded2eeb719345f952879 /test
parente8e29276b6864a489bf198c8fa29b1d08c176cc7 (diff)
downloadclang-9504ebbcec8f25e384f36e4145c0cee135a58d88.tar.gz
[analyzer] PR43551: Do not dereferce void* in UndefOrNullArgVisitor.
Patch by Kristóf Umann! Differential Revision: https://reviews.llvm.org/D68591 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@375329 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Analysis/novoidtypecrash.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/test/Analysis/novoidtypecrash.c b/test/Analysis/novoidtypecrash.c
index c04cfca29b..b19990a279 100644
--- a/test/Analysis/novoidtypecrash.c
+++ b/test/Analysis/novoidtypecrash.c
@@ -1,8 +1,27 @@
// RUN: %clang_analyze_cc1 -analyzer-checker=core %s
+x;
+y(void **z) { // no-crash
+ *z = x;
+ int *w;
+ y(&w);
+ *w;
+}
+
a;
-b(void **c) { // no-crash
- *c = a;
- int *d;
- b(&d);
- *d;
+b(*c) {}
+e(*c) {
+ void *d = f();
+ b(d);
+ *c = d;
+}
+void *g() {
+ e(&a);
+ return a;
+}
+j() {
+ int h;
+ char i = g();
+ if (i)
+ for (; h;)
+ ;
}