Nicholas Nethercote 0db1843d96 Made Addrcheck distinguish between invalid reads and invalid writes (previously
was just saying "invalid memory access").

Added a regression test for this, for memcheck and addrcheck.  Also made
Addrcheck use Memcheck's fprw regtest.  Was able to remove the not-very-useful
'true' test for Addrcheck now that it has a couple of real tests.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1815
2003-09-05 23:29:33 +00:00

18 lines
309 B
C

#include <stdlib.h>
int main(void)
{
void* x = malloc(10);
int* x4 = x-4;
short int* x2 = x-4;
char* 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;
return 0;
}