xref: /llvm-project/clang/test/Analysis/scan-build/Inputs/null_dereference_and_division_by_zero.c (revision 0b2a92224630f6e177d091b8391cfa943764aba5)

test(int x)1 int test(int x) {
2   if (x) {
3     int *p = 0;
4     return *p; // Null dereference.
5   } else {
6     return 1 / x; // Division by zero.
7   }
8 }
9