3 ms·
There's a fun example with clang where you can have two pointers where: x == y But: *x != *y It involves invoking undefined behavior by using a poin
by mikeash 13y ago
There's a fun example with clang where you can have two pointers where:
x == y
But:
*x != *y
It involves invoking undefined behavior by using a pointer after it's been freed and arranging for a new pointer at the exact same location. Clang cached the contents of the old pointer and uses it in the comparison.