mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-12 06:11:37 +00:00
Initial revision
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2
This commit is contained in:
36
tests/clientstackperm.c
Normal file
36
tests/clientstackperm.c
Normal file
@@ -0,0 +1,36 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "valgrind.h"
|
||||
|
||||
|
||||
int baaaad ( void )
|
||||
{
|
||||
int i;
|
||||
int spacer0[10];
|
||||
int aaa[10];
|
||||
int spacer1[10];
|
||||
int bbb[10];
|
||||
int spacer2[10];
|
||||
int ccc[10];
|
||||
int spacer3[10];
|
||||
VALGRIND_MAKE_NOACCESS_STACK(spacer0, sizeof spacer0);
|
||||
VALGRIND_MAKE_NOACCESS_STACK(spacer1, sizeof spacer1);
|
||||
VALGRIND_MAKE_NOACCESS_STACK(spacer2, sizeof spacer2);
|
||||
VALGRIND_MAKE_NOACCESS_STACK(spacer3, sizeof spacer3);
|
||||
printf("reading %p\n", &aaa[-3]);
|
||||
return aaa[-3];
|
||||
for (i = 0; i < 10; i++) {
|
||||
printf("poking addr %p\n", & spacer1[i]);
|
||||
spacer0[i] = spacer1[i] = spacer2[i] = spacer3[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main ( void )
|
||||
{
|
||||
int z = baaaad();
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user