summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/division-by-zero.c
blob: 33bb6fa3a6f5df89b6e262a83a71142537c5b9e4 (plain)
1
2
3
4
5
6
7
// 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;
}
OpenPOWER on IntegriCloud