http://reviews.llvm.org/D10145
Files:
test/Analysis/division-by-zero.c
Index: test/Analysis/division-by-zero.c
===================================================================
--- /dev/null
+++ test/Analysis/division-by-zero.c
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=unix.Malloc -verify %s
+// Do not crash due to division by zero
+
+int f(unsigned int a) {
+ if (a <= 0) return 1 / a;
+ return a;
+}
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
Index: test/Analysis/division-by-zero.c
===================================================================
--- /dev/null
+++ test/Analysis/division-by-zero.c
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=unix.Malloc -verify %s
+// Do not crash due to division by zero
+
+int f(unsigned int a) {
+ if (a <= 0) return 1 / a;
+ return a;
+}
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits