Hello,<div><br></div><div>I found a fondamental bug in Squeak and Pharo. The next code</div><div><br></div><div><span><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">11 / 2&nbsp;</span></span></div>
<div>
<br></div><div>gives the fraction (11/2). It&#39;s correct. But the next code</div><div><br></div><div><span><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">(SmallInteger&gt;&gt;#/) valueWithReceiver: 11 arguments: {2}</span></span><br>

</div><div><br></div><div>gives 1 !</div><div><br></div><div>The problem is the method <span>valueWithReceiver:arguements:</span> is used hugely with method wrappers...</div>
<div><br></div><div>After long time of debugging, I found a point to debug:&nbsp;this method don&#39;t have the good behavior with compiled methods having a primitive that fails and executes some code after (as in <span><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">SmallInteger&gt;&gt;#/</span></span> method when the division don&#39;t give a whole integer). In fact, when I send this message, the vm executes normally the compiled method but, in place of returns simply the good result, seems to rerun the the compiled method with other arguments (completly wrong) and returns so a wrong result.</div>

<div><br></div><div>For example,&nbsp;</div><div><span><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">(</span></span><span style="font-size:12px"><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">SmallInteger&gt;&gt;#/) valueWithReceiver: 11 arguments: {2}</span><span style="font-family:arial, helvetica, sans-serif"></span></span></div>

<div><span style="font-size:12px"><br></span></div><div><span style="font-size:12px"><span style="font-family:tahoma, sans-serif">has the following execution trace :</span></span></div>
<div><span style="font-family:tahoma;font-size:12px"><br></span></div><div><div><div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">2 isZero</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;2 = 0</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;returns: false</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">returns: false</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">2 isMemberOf: SmallInteger</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;2 class</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;returns: SmallInteger</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;SmallInteger == SmallInteger</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;returns: true</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">returns: true</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">Fraction numerator: 101 denominator: 2</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;Fraction new</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;Fraction basicNew</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;returns: a Fraction instance</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;(a Fraction instance)&nbsp;initialize</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;returns:&nbsp;a Fraction instance</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;returns:&nbsp;a Fraction instance</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;a Fraction instance&nbsp;setNumerator: 101 denominator: 2</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;2 = 0</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;returns: false</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;101 asInteger</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;returns: 101</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;2 asInteger</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;returns: 2</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;2 abs</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;| &nbsp;2 &lt; 0</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;| &nbsp;returns: false</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;returns: 2</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;2 &lt; 0</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;returns: false</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;returns: (101/2)</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">returns: (101/2)</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">(101/2) reduced</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;101 = 0</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;returns: false</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;101 gcd: 2</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;101 = 0</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;returns: false</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;2 \\ 101</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;returns: 2</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;2 = 0</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;returns: false</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;101 \\ 2</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;returns: 1</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;1 = 0</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;returns: false</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;2 \\ 1</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;returns: 0</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;0 = 0</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;returns: true</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;1 abs</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;| &nbsp;1 &lt; 0</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;| &nbsp;returns: false</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;returns: 1</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;returns: 1</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;101 // 1</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;returns: 101</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;2 // 1</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;returns: 2</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;2 = 1</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;returns: false</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;Fraction numerator: 101 denominator: 2</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;Fraction new</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;| &nbsp;Fraction basicNew</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;| &nbsp;returns: a Fraction instance</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;| &nbsp;(a Fraction instance) initialize</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;| &nbsp;returns:&nbsp;a Fraction instance</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;returns:&nbsp;a Fraction instance</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;(a Fraction instance)&nbsp;setNumerator: 101 denominator: 2</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;| &nbsp;2 = 0</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;| &nbsp;returns: false</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;| &nbsp;101 asInteger</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;| &nbsp;returns: 101</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;| &nbsp;2 asInteger</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;| &nbsp;returns: 2</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;| &nbsp;2 abs</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;| &nbsp;| &nbsp;2 &lt; 0</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;| &nbsp;| &nbsp;returns: false</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;| &nbsp;returns: 2</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;| &nbsp;2 &lt; 0</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;| &nbsp;returns: false</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;| &nbsp;returns: (101/2)</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;returns: (101/2)</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">returns: (101/2)</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">2 isZero</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;2 = 0</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;returns: false</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">returns: false</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">false isMemberOf: SmallInteger</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;false class</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;returns: False</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;False == SmallInteger</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">| &nbsp;returns: false</span></div><div><span class="Apple-style-span" style="font-family: &#39;courier new&#39;, monospace;">returns: false</span></div>
<div><br></div><div><br></div></div></div></div><div>Please help me to fix this bug. I really need it works fine !</div><div><br></div><div>Fréd<br>
-- <br>Frédéric Pluquet<br>Université Libre de Bruxelles (ULB)<br>Assistant<br><a href="http://www.ulb.ac.be/di/fpluquet" target="_blank">http://www.ulb.ac.be/di/fpluquet</a><br>
</div>