db/fixup_kernel.sh: update vfs_write() code
[smatch.git] / validation / bad-check-access0.c
blob3c4c023f2f89b67a800d7f1a7e2e351d2e78e5ce
1 #define SIZE 2
2 static int buf[SIZE];
4 static inline int swt(int i)
6 switch (i) {
7 case 0 ... (SIZE-1):
8 return buf[i];
9 default:
10 return 0;
14 static int switch_ok(void) { return swt(1); }
15 static int switch_ko(void) { return swt(2); }
18 static inline int cbr(int i, int p)
20 if (p)
21 return buf[i];
22 else
23 return 0;
26 static int branch_ok(int x) { return cbr(1, x != x); }
27 static int branch_ko(int x) { return cbr(2, x != x); }
30 * check-name: bad-check-access0