add uninitialized allocator tests
parent
2d168b0516
commit
fe85116891
|
@ -12,3 +12,6 @@ all: \
|
|||
invalid_free_protected \
|
||||
invalid_free_unprotected \
|
||||
invalid_free_small_region \
|
||||
uninitialized_free \
|
||||
uninitialized_realloc \
|
||||
uninitialized_malloc_usable_size \
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
__attribute__((optimize(0)))
|
||||
int main(void) {
|
||||
free((void *)1);
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
#include <malloc.h>
|
||||
|
||||
__attribute__((optimize(0)))
|
||||
int main(void) {
|
||||
malloc_usable_size((void *)1);
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
__attribute__((optimize(0)))
|
||||
int main(void) {
|
||||
void *p = realloc((void *)1, 16);
|
||||
if (!p) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue