clear what the messages are talking about.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2192
Invalid read of size 4
- at 0x........: main (badrw.c:12)
+ at 0x........: main (badrw.c:19)
Address 0x........ is 4 bytes before a block of size 10 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (badrw.c:5)
Invalid write of size 4
- at 0x........: main (badrw.c:12)
+ at 0x........: main (badrw.c:20)
Address 0x........ is 4 bytes before a block of size 10 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (badrw.c:5)
Invalid read of size 2
- at 0x........: main (badrw.c:13)
+ at 0x........: main (badrw.c:22)
Address 0x........ is 4 bytes before a block of size 10 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (badrw.c:5)
Invalid write of size 2
- at 0x........: main (badrw.c:13)
+ at 0x........: main (badrw.c:23)
Address 0x........ is 4 bytes before a block of size 10 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (badrw.c:5)
Invalid read of size 1
- at 0x........: main (badrw.c:14)
+ at 0x........: main (badrw.c:25)
Address 0x........ is 1 bytes before a block of size 10 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (badrw.c:5)
Invalid write of size 1
- at 0x........: main (badrw.c:14)
+ at 0x........: main (badrw.c:26)
Address 0x........ is 1 bytes before a block of size 10 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (badrw.c:5)
{
void* x = malloc(10);
- int* x4 = x-4;
- short int* x2 = x-4;
- char* x1 = x-1;
+ int *x4;
+ short *x2;
+ char *x1;
+ int y4;
+ short y2;
+ char y1;
+
+ x4 = x-4;
+ x2 = x-4;
+ x1 = x-1;
// Invalid reads and writes of sizes 4, 2, 1
- int y4 = *x4; *x4 = y4;
- short int y2 = *x2; *x2 = y2;
- char y1 = *x1; *x1 = y1;
+ y4 = *x4;
+ *x4 = y4;
+
+ y2 = *x2;
+ *x2 = y2;
+
+ y1 = *x1;
+ *x1 = y1;
return 0;
}
Invalid read of size 4
- at 0x........: main (badrw.c:12)
+ at 0x........: main (badrw.c:19)
Address 0x........ is 4 bytes before a block of size 10 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (badrw.c:5)
Invalid write of size 4
- at 0x........: main (badrw.c:12)
+ at 0x........: main (badrw.c:20)
Address 0x........ is 4 bytes before a block of size 10 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (badrw.c:5)
Invalid read of size 2
- at 0x........: main (badrw.c:13)
+ at 0x........: main (badrw.c:22)
Address 0x........ is 4 bytes before a block of size 10 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (badrw.c:5)
Invalid write of size 2
- at 0x........: main (badrw.c:13)
+ at 0x........: main (badrw.c:23)
Address 0x........ is 4 bytes before a block of size 10 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (badrw.c:5)
Invalid read of size 1
- at 0x........: main (badrw.c:14)
+ at 0x........: main (badrw.c:25)
Address 0x........ is 1 bytes before a block of size 10 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (badrw.c:5)
Invalid write of size 1
- at 0x........: main (badrw.c:14)
+ at 0x........: main (badrw.c:26)
Address 0x........ is 1 bytes before a block of size 10 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (badrw.c:5)