summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/division-by-zero.c
blob: d3c228e6c97dfa0673d1010e713bcd03bc9292ac (plain)
1
2
3
4
5
6
7
// RUN: %clang_cc1 -analyze -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