Minor tweaks. A few comments were out of synch with source.

Add another test.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12802
This commit is contained in:
Florian Krohm 2012-07-28 21:59:34 +00:00
parent 793d6da89c
commit d073e8f615
2 changed files with 14 additions and 3 deletions

View File

@ -95,19 +95,26 @@ int main()
/* Read 2 bytes from input buffer. First byte is uninitialised */
input = malloc(10);
input[0] = 0x0;
input[1] = 0x0;
do_cu21(malloc(4), 4, (void *)input, 2); // complaint
/* Read 2 bytes from input buffer. Second byte is uninitialised */
input = malloc(10);
input[1] = 0x0;
input[0] = 0x0;
do_cu21(malloc(4), 4, (void *)input, 2); // complaint
/* Read 2 bytes from input buffer. All bytes are uninitialised */
/* Read 2 bytes from input buffer. All bytes are initialised */
input = malloc(10);
input[0] = input[1] = 0x0;
do_cu21(malloc(4), 4, (void *)input, 2); // no complaint
/* Read 4 bytes from input buffer. This iterates once. In the 1st
iteration all input bytes are initialised in the 2nd iteration all
input bytes are uninitialised. */
input = malloc(10);
input[0] = input[1] = 0x0;
do_cu21(malloc(4), 4, (void *)input, 4); // complaint
/* Write to NULL */
// do_cu21(NULL, 10, pattern1, sizeof pattern1); // complaint

View File

@ -59,3 +59,7 @@ Conditional jump or move depends on uninitialised value(s)
at 0x........: do_cu21 (cu21.c:45)
by 0x........: main (cu21.c:104)
Conditional jump or move depends on uninitialised value(s)
at 0x........: do_cu21 (cu21.c:45)
by 0x........: main (cu21.c:116)