<div dir="ltr">Hi Levente,<div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 23, 2016 at 3:09 PM, Levente Uzonyi <span dir="ltr">&lt;<a href="mailto:leves@caesar.elte.hu" target="_blank">leves@caesar.elte.hu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I found that<br>
- it requires the use of primitive 83 with 3 arguments (aka #perform:with:with:. 2 and 4 argument variants don&#39;t trigger the bug)<br>
- its result must be passed immediately as an argument to another method (using a temporary to store the intermediate value won&#39;t trigger the error)<br>
- all this has to be evaluated in a block at least twice (the first evaluation won&#39;t trigger the bug).<br>
<br>
Here&#39;s a smaller example:<br>
<br>
[ &#39;&#39; copyReplaceFrom: 1 to: 0 with: (&#39;&#39; perform: #copyFrom:to: with: 1 with: 0) ] value; value<br>
<br>
I decided to use #copyReplaceFrom:to:with: instead of #,, because the former will raise a debugger due to the invalid arguments.<br>
<br>
Here&#39;s a different one:<br>
<br>
[ self haltIf: ({ true } perform: #at:put: with: 1 with: false) ] value; value<br>
<br>
This clearly shows, that first argument of #perform:with:with: stays on the stack somehow.<br>
<br>
Going through the code in the debugger doesn&#39;t trigger the bug, which makes me think that the jitted version of #perform:with:with: doesn&#39;t pop its first argument from the stack.</blockquote><div><br></div><div> Bingo!  Thanks.  In fact the primitive fails to pop all but the last argument.  I&#39;ll have a fix ready soon.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888">Levente</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
On Tue, 23 Feb 2016, Stéphane Rollandin wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I have a nice one:<br>
<br>
In (seemingly) any 5.0 image, with the latest Spur, type the following in a workspace and printIt a couple of time:<br>
<br>
<br>
(1 to: 3) collect: [:i |<br>
        m := &#39;&#39;.<br>
        2 timesRepeat: [m := m,  (&#39;1234&#39; perform: #copyFrom:to: with: 2 with: 4)].<br>
        m]<br>
<br>
<br>
I get kind of randomly either #(&#39;234&#39; &#39;&#39; &#39;&#39;) or the correct #(&#39;234234&#39; &#39;234234&#39; &#39;234234&#39;), or at times #(&#39;234234&#39; &#39;&#39; &#39;&#39;).<br>
<br>
<br>
Attached is the same code, this time in a method. It is even funkier, since a common answer is then &#39;copyFrom:to:234&#39;, although I sometimes get &#39;234234&#39; ...<br>
<br>
<br>
<br>
Stef<br>
<br>
</blockquote>
</div></div><br><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>