This patch adds a "value-after-delete" sanitizer, which will
invalidate the value of a pointer passed in a delete expression.
For instance, when -fsanitize=value-after-delete is passed:
int *foo = new int;
delete foo;
// foo == 0xDEADBEEFDEADBEEF
This is intended to help catch some use-after-free problems by
ensuring access through a deleted pointer fails immediately on
an address should be obviously suspicious when inspected in the
debugger. The expectation is immediately invalidating dangling
pointers can help uncover latent bugs that might otherwise cause
more subtle problems further down the line.
Why just delete and not free()?