<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">and I confirm it works :)<div class=""><br class=""></div><div class="">Esteban</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 25 Apr 2016, at 21:41, Nicolas Cellier &lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com" class="">nicolas.cellier.aka.nice@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">And thanks to Esteban for pointing me to the bug.<br class=""><br class=""></div><div class="gmail_extra"><br class=""><div class="gmail_quote">2016-04-25 21:22 GMT+02:00  <span dir="ltr" class="">&lt;<a href="mailto:commits@source.squeak.org" target="_blank" class="">commits@source.squeak.org</a>&gt;</span>:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="">
Nicolas Cellier uploaded a new version of VMMaker to project VM Maker:<br class="">
<a href="http://source.squeak.org/VMMaker/VMMaker.oscog-nice.1843.mcz" rel="noreferrer" target="_blank" class="">http://source.squeak.org/VMMaker/VMMaker.oscog-nice.1843.mcz</a><br class="">
<br class="">
==================== Summary ====================<br class="">
<br class="">
Name: VMMaker.oscog-nice.1843<br class="">
Author: nice<br class="">
Time: 25 April 2016, 8:24:03.731 pm<br class="">
UUID: 9ef5d374-ae5e-437a-9116-cde9d708c0d7<br class="">
Ancestors: VMMaker.oscog-cb.1842<br class="">
<br class="">
Fix my recent bug for signed 32bit long access (introduced beginning of April).<br class="">
<br class="">
One symptom is:<br class="">
&nbsp; (Alien newGC: 4)<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; signedLongAt: 1 put: -16r7287E552;<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; signedLongAt: 1<br class="">
<br class="">
I incorrecly used the signed value (integerValue) in one branch, and the magnitude (value) in the other branch...<br class="">
This is an incorrect copy/paste from maybeInlinePositive32BitIntegerFor: in my ultimate #if SPURVM refactoring.<br class="">
<br class="">
While at it, avoid the confusion by using a better variable name (magnitude), and eliminate UB related to computing opposite of INT_MIN by explicitely using unsigned type.<br class="">
<br class="">
=============== Diff against VMMaker.oscog-cb.1842 ===============<br class="">
<br class="">
Item was changed:<br class="">
&nbsp; ----- Method: StackInterpreter&gt;&gt;noInlineSigned32BitIntegerFor: (in category 'primitive support') -----<br class="">
&nbsp; noInlineSigned32BitIntegerFor: integerValue<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; "Answer a full 32 bit integer object for the given integer value."<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; &lt;notOption: #Spur64BitMemoryManager&gt;<br class="">
+&nbsp; &nbsp; &nbsp; &nbsp;| newLargeInteger magnitude largeClass |<br class="">
-&nbsp; &nbsp; &nbsp; &nbsp;| newLargeInteger value largeClass |<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; &lt;inline: false&gt;<br class="">
+&nbsp; &nbsp; &nbsp; &nbsp;&lt;var: 'magnitude' type: 'unsigned int'&gt;<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; (objectMemory isIntegerValue: integerValue) ifTrue:<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [^objectMemory integerObjectOf: integerValue].<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; self deny: objectMemory hasSixtyFourBitImmediates.<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;integerValue &lt; 0<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ifTrue: [largeClass := ClassLargeNegativeIntegerCompactIndex.<br class="">
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;magnitude := 0 asUnsignedInteger - integerValue]<br class="">
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value := 0 - integerValue]<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ifFalse: [largeClass := ClassLargePositiveIntegerCompactIndex.<br class="">
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;magnitude := integerValue].<br class="">
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value := integerValue].<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; newLargeInteger := objectMemory<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; eeInstantiateSmallClassIndex: largeClass<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; format: (objectMemory byteFormatForNumBytes: 4)<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; numSlots: 1.<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; self cppIf: SPURVM<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ifTrue:<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ["Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero"<br class="">
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;objectMemory storeLong32: 0 ofObject: newLargeInteger withValue: (objectMemory byteSwapped32IfBigEndian: magnitude).<br class="">
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;objectMemory storeLong32: 0 ofObject: newLargeInteger withValue: (objectMemory byteSwapped32IfBigEndian: integerValue).<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; objectMemory storeLong32: 1 ofObject: newLargeInteger withValue: 0]<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ifFalse:<br class="">
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[objectMemory storeLong32: 0 ofObject: newLargeInteger withValue: (objectMemory byteSwapped32IfBigEndian: magnitude)].<br class="">
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[objectMemory storeLong32: 0 ofObject: newLargeInteger withValue: (objectMemory byteSwapped32IfBigEndian: value)].<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; ^newLargeInteger!<br class="">
<br class="">
</blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></body></html>