<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;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: 0 0 0 40px; border: none; padding: 0px;">
<div>[true]</div>
<div><span style="white-space:pre"></span>whileTrue;</div>
<div><span style="white-space:pre"></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" contenttype="image/png" id="img437184" style="max-width: 99.9%; user-select: none;" contextid="img325" tabindex="0" src="cid:60074202-9794-48ae-a5fd-57507c88211b"><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: 0 0 0 40px; border: 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;"></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;"></span>[true]</div>
</span></span></div>
<div><span><span>
<div><span style="white-space:pre"><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;"></span></span>whileTrue;</div>
</span></span></div>
<div><span><span>
<div><span style="white-space:pre"><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;"></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" contenttype="image/png" id="img760294" style="max-width: 99.9%; user-select: none;" contextid="img995373" tabindex="0" src="cid:8ddf552d-c1a1-4498-9284-472389ef8208"><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="Signature">
<div id="divtagdefaultwrapper" 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" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div>
<div class="_rp_T4" id="Item.MessagePartBody">
<div class="_rp_U4 ms-font-weight-regular ms-font-color-neutralDark rpHighlightAllClass rpHighlightBodyClass" id="Item.MessageUniqueBody" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<div dir="ltr">
<div id="divtagdefaultwrapper"><font face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols">
<div id="Signature">
<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>
</body>
</html>