njn | c2699f6 | 2003-09-05 23:29:33 +0000 | [diff] [blame] | 1 | #include <stdlib.h> |
2 | |||||
3 | int main(void) | ||||
4 | { | ||||
5 | void* x = malloc(10); | ||||
6 | |||||
7 | int* x4 = x-4; | ||||
8 | short int* x2 = x-4; | ||||
9 | char* x1 = x-1; | ||||
10 | |||||
11 | // Invalid reads and writes of sizes 4, 2, 1 | ||||
12 | int y4 = *x4; *x4 = y4; | ||||
13 | short int y2 = *x2; *x2 = y2; | ||||
14 | char y1 = *x1; *x1 = y1; | ||||
15 | |||||
16 | return 0; | ||||
17 | } |