add test for delete size mismatch

This commit is contained in:
Daniel Micay committed 2018-10-11 01:45:47 -04:00
1 parent 7606bf4c1f
commit e47c783524
2 files changed
+15 -1

No files matched your search

+2 -1
View File
@@ -22,7 +22,8 @@ EXECUTABLES := \
uninitialized_malloc_usable_size \
eight_byte_overflow_small \
eight_byte_overflow_large \
string_overflow
string_overflow \
delete_type_size_mismatch
all: $(EXECUTABLES)
@@ -0,0 +1,13 @@
#include <stdint.h>
struct foo {
uint64_t a, b, c, d;
};
__attribute__((optimize(0)))
int main(void) {
void *p = new char;
struct foo *c = (struct foo *)p;
delete c;
return 0;
}