diff --git a/addrcheck/tests/badrw.stderr.exp b/addrcheck/tests/badrw.stderr.exp index a6f168c7b..77c3f4a21 100644 --- a/addrcheck/tests/badrw.stderr.exp +++ b/addrcheck/tests/badrw.stderr.exp @@ -1,35 +1,35 @@ 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) diff --git a/memcheck/tests/badrw.c b/memcheck/tests/badrw.c index b72f39361..d711ec969 100644 --- a/memcheck/tests/badrw.c +++ b/memcheck/tests/badrw.c @@ -4,14 +4,26 @@ int main(void) { 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; } diff --git a/memcheck/tests/badrw.stderr.exp b/memcheck/tests/badrw.stderr.exp index a6f168c7b..77c3f4a21 100644 --- a/memcheck/tests/badrw.stderr.exp +++ b/memcheck/tests/badrw.stderr.exp @@ -1,35 +1,35 @@ 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)