This commit is contained in:
Nilstrieb 2022-07-22 14:40:23 +00:00
parent bd20f8a3bc
commit e6effff870
5 changed files with 11 additions and 11 deletions

View file

@ -111,8 +111,8 @@ that is implemented in Miri. For an excellent introduction, see this part of the
and only the pointers that have their tag in the stack are allowed to access it. Tags can be pushed and popped from the stack through various operations, for example borrowing.</p>
<p>In the code example above, we get a nice little hint where the tag was created. When we created a reference (that was then
coerced into a raw pointer) from our box, it got a new tag called <code><3314></code>. Then, when we moved the box into the function,
something happened: The tag was invalidated and popped off the borrow stack. That’s because box invalidates all tags when it’s
moved. The tag was popped off the borrow stack and we tried to read from it anyways - undefined behaviour happened!</p>
something happened: The tag was popped off the borrow stack and therefore invalidated. That’s because box invalidates all tags
when it’s moved. The tag was popped off the borrow stack and we tried to read with it anyways - undefined behaviour happened!</p>
<p>And that’s how our code wasn’t a miscompilation, but undefined behaviour. Quite surprising, isn’t it?</p>
<h1 id="noalias-nothanks">noalias, nothanks</h1>
<p>Many people, myself included, don’t think that this is a good thing.</p>