<div dir="ltr"><div>Hi Christoph,</div><div>it's possible that I've already fixed that a few years ago, but it was not considered useful enough.</div><div>Is this really a problem?<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le sam. 28 déc. 2019 à 15:53, Thiede, Christoph <<a href="mailto:Christoph.Thiede@student.hpi.uni-potsdam.de">Christoph.Thiede@student.hpi.uni-potsdam.de</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<div id="gmail-m_-133881663338805227divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p>Hi all! :-)</p>
<p><b><br>
</b></p>
<p><b>Steps to reproduce:</b></p>
<p>Do it:</p>
<p></p>
<blockquote style="margin:0px 0px 0px 40px;border:medium none;padding:0px">
<div>[true]</div>
<div><span style="white-space:pre-wrap"></span>whileTrue;</div>
<div><span style="white-space:pre-wrap"></span>whileFalse</div>
</blockquote>
<div></div>
<div><br>
</div>
<div><b>Expected behavior:</b></div>
<div>The script is compiled and executed (and an infinite loop occurs).</div>
<div><br>
</div>
<div><b>Actual behavior:</b></div>
<div><img size="43032" id="gmail-m_-133881663338805227img437184" style="max-width: 99.9%;" src="cid:16f4d2a6581f456b1e51"><br>
</div>
<div><br>
</div>
<div><b>Further investigations:</b></div>
<div>In #<span>analyseTempsWithin:rootNode:assignmentPools:, the inner BlockNode [true] is not computed a blockExtent, because it is optimized.</span></div>
<div><span>This leads to a nil key in the ByteCodeEncoder's blockExtentsToLocals.</span></div>
<div><span>A fast solution would be to skip nil blockExtents in #<span>noteBlockExtent:hasLocals:, but that's a dirty workaround.</span></span></div>
<div><span><span><br>
</span></span></div>
<div><span><span><b>Similar bug:</b></span></span></div>
<div><span><span>Try to do:</span></span></div>
<blockquote style="margin:0px 0px 0px 40px;border:medium none;padding:0px">
<div><span><span>
<div>Object newSubclass compile:  'iWontCompile: foo</div>
</span></span></div>
<div><span><span>
<div><span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px;white-space:pre-wrap"></span>foo.</div>
</span></span></div>
<div><span><span>
<div><span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px;white-space:pre-wrap"></span>[true]</div>
</span></span></div>
<div><span><span>
<div><span style="white-space:pre-wrap"><span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px;white-space:pre-wrap"></span></span>whileTrue;</div>
</span></span></div>
<div><span><span>
<div><span style="white-space:pre-wrap"><span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px;white-space:pre-wrap"></span></span>whileFalse'</div>
</span></span></div>
</blockquote>
<div><span><span>
<div></div>
<div></div>
<div></div>
</span></span></div>
<div>Fails with:</div>
<div><img size="38107" id="gmail-m_-133881663338805227img760294" style="max-width: 99.9%;" src="cid:16f4d2a6581f456b1e52"><br>
</div>
<div>Again, the problem is that blockExtent isNil.</div>
<div><br>
</div>
<div><b>Workaround:</b></div>
<div>Send #yourself to the block before sending the cascade. This prevents the receiver from being optimized.</div>
<div><br>
</div>
<div>Please note that this problem does not only occur in case of special blocks. For example, <span style="font-size:12pt">[Sensor anyButtonPressed] </span><span style="font-size:12pt">whileTrue; </span><span style="font-size:12pt">whileFalse fails as
 well.</span></div>
<div><br>
</div>
<div><br>
</div>
<div>How to fix this appropriately? I'm not sure whether I understand the whole idea of blockExtent so far. According to the documentation comment, it should be okay to be nil; however, the #blockExtent comment does not mention this fact.</div>
<div>Please see the attached changeset for an approach to fix the issue. All tests from KernelTests-Methods and most tests from Test-Compiler pass it, except of the testAllNodePCs* which time out in my fresh image. It would be great to hear if this is the right
 way to solve the bug, or just extending a workaround :-)</div>
<div><br>
</div>
<div>Best,</div>
<div>Christoph</div>
<div id="gmail-m_-133881663338805227Signature">
<div id="gmail-m_-133881663338805227divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div name="divtagdefaultwrapper">
<div>
<div id="gmail-m_-133881663338805227Item.MessagePartBody">
<div id="gmail-m_-133881663338805227Item.MessageUniqueBody" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<div dir="ltr">
<div id="gmail-m_-133881663338805227divtagdefaultwrapper"><font face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols">
<div id="gmail-m_-133881663338805227Signature">
<div style="margin:0px"><font style="font-family:Calibri,Arial,Helvetica,sans-serif,serif,EmojiFont"></font></div>
</div>
</font></div>
</div>
</div>
</div>
</div>
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
</div>

<br>
</blockquote></div>