]> git.ralfj.de Git - web.git/blobdiff - personal/_posts/2020-12-14-provenance.md
provenacne blog post: clarification
[web.git] / personal / _posts / 2020-12-14-provenance.md
index 249c3e4dcfb83a08ee06da561d10fc7f601c3e80..78e2538c65c26084a9f5c6f5cb4890a4df849d6d 100644 (file)
@@ -1,6 +1,6 @@
 ---
 title: "Pointers Are Complicated II, or: We need better language specs"
-categories: rust research
+categories: rust research programming
 forum: https://internals.rust-lang.org/t/pointers-are-complicated-ii-or-we-need-better-language-specs/13562
 license: CC BY-SA 4.0
 license-url: https://creativecommons.org/licenses/by-sa/4.0/
@@ -123,7 +123,8 @@ This program has two possible behaviors: either `ip` (the address one-past-the-e
 Or the two are equal, in which case the program will print "10" (`iq` is the result of casting `q` to an integer, so casting it back will yield the original pointer, or at least a pointer pointing to the same object / location in memory).
 
 The first "optimization" we will perform is to exploit that if we enter the `if` body, we have `iq == ip`, so we can replace all `iq` by `ip`.
-Subsequently the definition of `ip` is inlined:
+The assignment thus becomes `*(char*)ip = 10`.
+Subsequently, the definition of `ip` is inlined:
 {% highlight c %}
 char p[1], q[1] = {0};
 uintptr_t ip = (uintptr_t)(p+1);