diff --git a/test/simple-memory-corruption/Makefile b/test/simple-memory-corruption/Makefile index 734ab63..2b7852c 100644 --- a/test/simple-memory-corruption/Makefile +++ b/test/simple-memory-corruption/Makefile @@ -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) diff --git a/test/simple-memory-corruption/delete_type_size_mismatch.cc b/test/simple-memory-corruption/delete_type_size_mismatch.cc new file mode 100644 index 0000000..a3b13b4 --- /dev/null +++ b/test/simple-memory-corruption/delete_type_size_mismatch.cc @@ -0,0 +1,13 @@ +#include + +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; +}