4 ms·
> No modern systems have such trap representations for pointer types This may be incidentally true, but "address sanitizer"-like features are becoming more com
by zozbot234 7y ago
> No modern systems have such trap representations for pointer types
This may be incidentally true, but "address sanitizer"-like features are becoming more common on modern hardware, and while these do not currently trap on creation/manipulation of a 'wild' pointer (since, strictly speaking, a trap only happens on dereferencing), there's no solid reason to expect this to remain the case in the future.
- int_19h 7y agoI don't see how you could trap creation or manipulation, since those pointers are stored in registers and/or memory, and both are fundamentally untyped. How would the hardware even know that something is a pointer, on any architecture that is popular today?
- saagarjha 7y agoBecause you use typed instructions to access them. For example, on ARM with pointer authentication you’ll sign pointers and unsign them right before using them. If you forge a pointer it’ll cause a crash when it’s used because its signature will be incorrect.
- int_19h 7y agoBut that would still happen at the point of dereference, no? Or does it allow to tag even operations like moves and adds?