expressions: make assign_expression() take an op argument
[smatch.git] / validation / sm_array_overflow3.c
blob0bc93ac323263aa039e9345ccde06c123cadadf4
1 #include <stdio.h>
3 #define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
5 int a[] = {1, 2, 3, 4};
7 int main(void)
9 int *p;
11 for (p = a; p < &a[ARRAY_SIZE(a)]; p++)
12 printf("%d\n", *p);
13 p = &a[5];
14 return 0;
17 * check-name: smatch array check #3
18 * check-command: smatch sm_array_overflow3.c
20 * check-output-start
21 sm_array_overflow3.c:13 main() error: buffer overflow 'a' 4 <= 5
22 * check-output-end