Pointer comparisons ignore provenance
Pointer comparisons ignore provenance
Posted Oct 19, 2024 19:41 UTC (Sat) by NYKevin (subscriber, #129325)In reply to: Pointer comparisons ignore provenance by tialaramex
Parent article: Zapping pointers out of thin air
(1) is not semantically equivalent to (2). Under (2), if you tell me that pointers x and y are equal, then I am entitled to assume that they have the same provenance and so I can use either pointer to access the same object. Furthermore, (2) also extends to atomic compare-and-swap, meaning that you are required to ensure that the whole pointer-zapping problem described in the article does not arise in the first place (or at least, that the resulting binary behaves as if the problem does not arise).
(1) provides neither of those guarantees, so it is not equivalent to (2) no matter how lucky or unlucky I might get.
The LWN site is currently under high scraper load, so comment display has been suppressed for anonymous users. If you are a human, you may read the comments by clicking the button below:
Note: you can avoid this step in the future by logging into your LWN account.
