Skip to content

Commit db2cbe7

Browse files
committed
for MSVC we only have assembly
1 parent 0667b00 commit db2cbe7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

text/0000-rust-has-provenance.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ The given program has UB, but the [alternative program](https://play.rust-lang.o
8989

9090
This optimization is performed by both [GCC](https://godbolt.org/z/G3jYEnWx6), [clang](https://godbolt.org/z/cr7h6hhqf), and [ICC](https://godbolt.org/z/14b1d16Gc):
9191
in all cases, the program prints `42`, showing that the initial value of `p2` is printed, not the value that was written just above the `print` call -- despite the fact that that write definitely stores to the same address that `print` is printing from.
92+
I wasn't able to find a website that can build and run code with MSVC, but [this assembly](https://godbolt.org/z/dzPz8WM7Y) seems to indicate that it, too, would call `print` with an argument of `42`, and thus is using provenance.
9293
This is not a new phenomenon either; it goes back at least to [GCC 4.6.4](https://godbolt.org/z/Yx6f389Gf) (released in 2013) and [clang 3.4.1](https://godbolt.org/z/nnhn6fdnj) (released in 2014).
9394
This demonstrates that both of them implement a language that has pointer provenance.[^cstandard]
9495

0 commit comments

Comments
 (0)