3 ms·
> We guarantee type and memory safety by introducing a new exception (DanglingReferenceException) with the following semantics: a dereference to a deleted objec
by 7197ghr918hf 9y ago
> We guarantee type and memory safety by introducing a
new exception (DanglingReferenceException) with the
following semantics: a dereference to a deleted object
will either succeed as if that very object was not yet
deleted, or result in a DanglingReferenceException.
I would worry about what might happen in a variable-sized object reuse/freelist type scheme combined with this allocator. A dangling reference might not contain garbage that allows an attacker to control program flow, while still containing data that is exploitable in other ways.
So this is not an entirely safe way to do things. Arguably it would be worth the speedup. But many of the techniques for making this approach safe . . .
> such exceptions can be detected with the combination of rigorous testing and support in the allocator for a debug mode that enforces stronger semantics (i.e. exceptions on every dereference to a deleted object) at a higher cost
. . . can also be used to test C++. For example, we use https://github.com/google/sanitizers https://github.com/google/sanitizers a lot at the office to detect these sorts of errors.
Still, an interesting and clever result. Nicely done!