mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-03 18:13:01 +00:00
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
18 lines
309 B
C
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;
|
|
}
|