summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2014-09-05 16:33:51 +0000
committerJordan Rose <jordan_rose@apple.com>2014-09-05 16:33:51 +0000
commitf69e65f75cc315b219bd1efbb7093c2d1499f4e1 (patch)
tree921aa8b1a32350cdda7475562b6effa04987c481 /clang/test
parent901ba6ea2e218973e1e2c7a49995e7eb6e784bf4 (diff)
downloadbcm5719-llvm-f69e65f75cc315b219bd1efbb7093c2d1499f4e1.tar.gz
bcm5719-llvm-f69e65f75cc315b219bd1efbb7093c2d1499f4e1.zip
[analyzer] Don't crash if malloc() has an unexpected function prototype.
Patch by Daniel Fahlgren! llvm-svn: 217258
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Analysis/malloc-protoype.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/Analysis/malloc-protoype.c b/clang/test/Analysis/malloc-protoype.c
new file mode 100644
index 00000000000..f056f0f2855
--- /dev/null
+++ b/clang/test/Analysis/malloc-protoype.c
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -w -analyze -analyzer-checker=core,unix.Malloc -verify %s
+// expected-no-diagnostics
+
+// Test that strange prototypes doesn't crash the analyzer
+
+void malloc(int i);
+void valloc(int i);
+
+void test1()
+{
+ malloc(1);
+}
+
+void test2()
+{
+ valloc(1);
+}
OpenPOWER on IntegriCloud