Adding upstream version 1.65.7.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
5189956325
commit
32b8eb3fd7
4153 changed files with 2487292 additions and 0 deletions
15
testdata/memgrind/badfree.c
vendored
Normal file
15
testdata/memgrind/badfree.c
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
// This program attempts to free a pointer not acquired by malloc/calloc/realloc.
|
||||
//
|
||||
// Compile to Go: `$ ccgo -o main.go badfree.c`.
|
||||
//
|
||||
// To run the resulting Go code: `$ go run main.go`.
|
||||
//
|
||||
// To run the resulting Go code with memgrind: `$ go run -tags=libc.memgrind main.go`.
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
int main() {
|
||||
int i;
|
||||
free(&i);
|
||||
}
|
||||
|
16
testdata/memgrind/doublefree.c
vendored
Normal file
16
testdata/memgrind/doublefree.c
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
// This program frees allocated memory twice.
|
||||
//
|
||||
// Compile to Go: `$ ccgo -o main.go doublefree.c`.
|
||||
//
|
||||
// To run the resulting Go code: `$ go run main.go`.
|
||||
//
|
||||
// To run the resulting Go code with memgrind: `$ go run -tags=libc.memgrind main.go`.
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
int main() {
|
||||
void *p = malloc(42);
|
||||
free(p);
|
||||
free(p);
|
||||
}
|
||||
|
13
testdata/memgrind/leak.c
vendored
Normal file
13
testdata/memgrind/leak.c
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
// This program leaks memory.
|
||||
//
|
||||
// Compile to Go: `$ ccgo -o main.go leak.c`.
|
||||
//
|
||||
// To run the resulting Go code: `$ go run main.go`.
|
||||
//
|
||||
// To run the resulting Go code with memgrind: `$ go run -tags=libc.memgrind main.go`.
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
int main() {
|
||||
malloc(42);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue