about summary refs log tree commit diff homepage
path: root/runtime/Intrinsic/klee_div_zero_check.c
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/Intrinsic/klee_div_zero_check.c')
-rw-r--r--runtime/Intrinsic/klee_div_zero_check.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/runtime/Intrinsic/klee_div_zero_check.c b/runtime/Intrinsic/klee_div_zero_check.c
new file mode 100644
index 00000000..3fde1af5
--- /dev/null
+++ b/runtime/Intrinsic/klee_div_zero_check.c
@@ -0,0 +1,15 @@
+//===-- klee_div_zero_check.c ---------------------------------------------===//
+//
+//                     The KLEE Symbolic Virtual Machine
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <klee/klee.h>
+
+void klee_div_zero_check(long long z) {
+  if (z == 0)
+    klee_report_error(__FILE__, __LINE__, "divide by zero", "div.err");
+}