blob: b72f39361bd9c3160ec11367d8866d604c5d3237 [file] [log] [blame]
njnc2699f62003-09-05 23:29:33 +00001#include <stdlib.h>
2
3int 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}