blob: d711ec969b771c4795f0580bfe29e2cf43fd3bfb [file] [log] [blame]
njnc2699f62003-09-05 23:29:33 +00001#include <stdlib.h>
2
3int main(void)
4{
5 void* x = malloc(10);
6
fitzhardingeeed7ecb2004-01-07 08:47:03 +00007 int *x4;
8 short *x2;
9 char *x1;
10 int y4;
11 short y2;
12 char y1;
13
14 x4 = x-4;
15 x2 = x-4;
16 x1 = x-1;
njnc2699f62003-09-05 23:29:33 +000017
18 // Invalid reads and writes of sizes 4, 2, 1
fitzhardingeeed7ecb2004-01-07 08:47:03 +000019 y4 = *x4;
20 *x4 = y4;
21
22 y2 = *x2;
23 *x2 = y2;
24
25 y1 = *x1;
26 *x1 = y1;
njnc2699f62003-09-05 23:29:33 +000027
28 return 0;
29}