3 ms·
"based on pointer providence" I think you meant "provenance" (mentioning it for the sake of anyone who wants to search for it).
by _kst_ 7y ago
"based on pointer providence"
I think you meant "provenance" (mentioning it for the sake of anyone who wants to search for it).
- rseacord 7y agoYes, my mistake--I was thinking of Rhode Island. I wrote a short bit about this at https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2019/june/pointer-provenance/ https://www.nccgroup.trust/us/about-us/newsroom-and-events/b... if anyone is interested.
- flatfinger 7y agoWhat makes pointer provenance really great is that clang and gcc will treat that pointers that are observed to have the same address as freely interchangeable, even if their provenance is different. Clang sometimes even goes so far with that concept that even uintptr_t comparisons won't help. extern int x[],y[]; int test(int i) { y[0] = 1; if ((uintptr_t)(x+5) == (uintptr_t)(y+i)) y[i] = 2; return y[0]; } If this function is invoked with i==0, it should be possible for y[0] and the return value to both be 1, or both be 2. If x has five elements, however, and y immediately follows it, clang's generated code will set y[0] to 2 and yet return 1. Cool, eh?