llvm-for-llvmta/tools/clang/test/Analysis/division-by-zero.c

8 lines
167 B
C
Raw Normal View History

2022-04-25 13:02:35 +02:00
// RUN: %clang_analyze_cc1 -analyzer-checker=unix.Malloc %s
// Do not crash due to division by zero
int f(unsigned int a) {
if (a <= 0) return 1 / a;
return a;
}