|
|
|
|
|
by afdbcreid
12 days ago
|
|
> However, there are extant examples where you can just trick LLVM into asserting that two integers a,b are different and then showing that a - b == 0 which proves it was lying, those are by definition miscompilations and they don't rely on Exposure, they're just getting the LLVM optimiser to apply a pointer provenance optimisation to a thing it was just told is not a pointer. If I'm getting what you mean correctly, that's not true. Integers do not have provenance and if `a - b == 0` then `a == b` when a, b are integers. The problem is only when LLVM concludes from this that `a as *const _ == b as *const _`, and that doesn't exist for strict provenance. |
|
Well, what I'm doing here is describing the real situation with LLVM. If by "that's not true" you mean "that would be a bug in LLVM" then, uh, yeah, we know that it's a bug in LLVM. The LLVM maintainers know it's a bug in LLVM, have for many years.
> Integers do not have provenance
No, integers shouldn't have provenance. Due to this compiler bug unfortunately we can give integers provenance and blow up the world. Remembering the difference between what is and what should be is important, most especially in Criminal Justice.
So as to not rag specifically on LLVM, here's a ticket with Martin in the comments where somebody blew up GNU's C compiler on essentially the same trick question:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119472