Gitiles
Code Review
Sign In
gerrit-public.fairphone.software
/
fp2-dev
/
platform
/
external
/
valgrind
/
c2699f68c3c8596bc738cc45e76ae77e16ddcaf7
/
.
/
memcheck
/
tests
/
badrw.c
blob: b72f39361bd9c3160ec11367d8866d604c5d3237 [
file
] [
log
] [
blame
]
#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
;
}