|
From: Jeremy F. <je...@go...> - 2004-01-07 08:47:33
|
CVS commit by fitzhardinge:
Make badrw.c conform to C89; split things onto separate lines so it's
clear what the messages are talking about.
M +6 -6 addrcheck/tests/badrw.stderr.exp 1.4
M +18 -6 memcheck/tests/badrw.c 1.2
M +6 -6 memcheck/tests/badrw.stderr.exp 1.4
--- valgrind/memcheck/tests/badrw.c #1.1:1.2
@@ -5,12 +5,24 @@ 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;
--- valgrind/memcheck/tests/badrw.stderr.exp #1.3:1.4
@@ -1,4 +1,4 @@
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:...)
@@ -6,5 +6,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:...)
@@ -12,5 +12,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:...)
@@ -18,5 +18,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:...)
@@ -24,5 +24,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:...)
@@ -30,5 +30,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:...)
--- valgrind/addrcheck/tests/badrw.stderr.exp #1.3:1.4
@@ -1,4 +1,4 @@
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:...)
@@ -6,5 +6,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:...)
@@ -12,5 +12,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:...)
@@ -18,5 +18,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:...)
@@ -24,5 +24,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:...)
@@ -30,5 +30,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:...)
|