<html><head></head><body>  <div>Ahh, yes. Here we are. Thanks, Elliot.</div><div><br></div>A comment in String>>#keywords sez ::<div><br></div><div>"Has a final keyword, as in #nextPut::andCR"</div><div><br></div><div>Wot? WoT’s this? Is there some sort of trailing keyword allowed???</div><div><br></div><div>•••</div><div><br></div><div>Here’s an extension method I’m now using, called with:</div><div><br></div><div> <i><b>  methodSignature := ‘detect:ifNone:’ </b></i><span style="font-size: 16px; font-variant-caps: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><i><b>messageSignatureFromArguments: { [:each | each isIt ]. [nil] }.</b></i></span></div><div><br></div><div><div><i>String>>#</i>messageSignatureFromArguments:<i> arguments</i></div><div><i><span class="Apple-tab-span" style="white-space:pre">   </span>"Answer an array of the keywords, insterspersed with the argument names, that compose the receiver."</i></div><div><i><span class="Apple-tab-span" style="white-space:pre">    </span>| selectorStream |</i></div><div><i><span class="Apple-tab-span" style="white-space:pre">        </span>selectorStream := '' writeStream.</i></div><div><i><span class="Apple-tab-span" style="white-space:pre"> </span>(self numArgs = 0)</i></div><div><i><span class="Apple-tab-span" style="white-space:pre">                </span>ifTrue: [selectorStream nextPutAll: self]</i></div><div><i><span class="Apple-tab-span" style="white-space:pre">         </span>ifFalse: [self keywords with: arguments </i></div><div><i><span class="Apple-tab-span" style="white-space:pre">                     </span>do: [:keyword :argument | selectorStream nextPutAll: keyword, '<caret></caret> ', argument, ' ']].</i></div><div><i><span class="Apple-tab-span" style="white-space:pre">    </span>^ selectorStream contents</i></div><div><br></div><div id="protonmail_signature_block" class="protonmail_signature_block"><div>—<br>Have a good one; keep it, light.<br>Kindly, rabbit . .. … ‘…^,^ 🐇🐇🐇<br><br>Sent from Callisto House mobile - Ganymede<br>:: decentralized mobile homeless solutions ::</div></div> <div class="signature_br" contenteditable="false"><br></div><div class="signature_br" contenteditable="false"><br></div>  <div><br></div><div><br></div>On Thu, Jan 12, 2023 at 11:46, Eliot Miranda <<a href="mailto:eliot.miranda@gmail.com" class="">eliot.miranda@gmail.com</a>> wrote:<blockquote class="protonmail_quote" type="cite">  Hi Florin,  I’ll take a look asap but in return I must ask you to subscribe to squeak-dev and use vm-dev for its intended purpose :-)<br><br><div dir="ltr"><span style="background-color: rgba(255, 255, 255, 0);">_,,,^..^,,,_ (phone)</span></div><div dir="ltr"><br><blockquote type="cite">On Jan 11, 2023, at 4:38 PM, Florin Mateoc <florin.mateoc@gmail.com> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><span><div dir="ltr"><div>Hi Eliot,</div><div><br></div><div>Thank you for fixing the decompiler.</div><div><br></div><div>And now for an actual compiler bug :)</div><div>It is not critical, but it's a bug nonetheless: the parser "swallows" comments for the last statement in blocks where the statement is not a return and it ends with a period. <br></div><div>In these situations, the parser ends up calling addComment twice on the same parseNode, nilling out the comment that was put there in the first call.</div><div><br></div><div>As an example:</div><div><br></div><div>test<br>                true ifTrue: [self yourself. "a comment"]</div><div><br></div><div>or, even simpler:</div><div><br></div><div>test<br>              self yourself. "a comment"</div><div><br></div><div>All the best,</div><div>Florin<br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 10, 2023 at 12:19 AM Florin Mateoc <<a href="mailto:florin.mateoc@gmail.com">florin.mateoc@gmail.com</a>> wrote:<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>To be more precise, I do agree with you that the bug has nothing to do with Compiler-eem.483, and it is rather related to the perturbations that the new bytecode set and the full blocks have introduced into the delicate machinery of the decompiler.</div><div>I am pretty sure that, in a parallel universe, someone wrote or generated a method that is triggering the same bug without the compiler changes, we have just not stumbled upon it yet :)<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 9, 2023 at 8:45 PM Florin Mateoc <<a href="mailto:florin.mateoc@gmail.com">florin.mateoc@gmail.com</a>> wrote:<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>It's weirder than that. <br></div><div>I don't think
<span style="color:rgb(0,0,0)">Compiler-eem.483</span> itself introduces any bug, but the changes it introduces are enough to make the bug appear.</div><div>Compile with SistaV1 bytecode set and full blocks in the stable 6.0 release (which is prior to
<span style="color:rgb(0,0,0)">Compiler-eem.483</span>) and decompilation works there as well<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 9, 2023 at 7:53 PM Eliot Miranda <<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>> wrote:<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 class="gmail_default" style="font-size:small">BTW, it's not to do with <span style="color:rgb(0,0,0)">Compiler-eem.483; it's to do with the SistaV1 bytecode set and full blocks.  Compile with the old bytecode set and embedded blocks and decompilation works.</span></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 9, 2023 at 10:45 AM Eliot Miranda <<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>> wrote:<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 class="gmail_default" style="font-size:small">Hi Florin,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">    I've found the issue, which is an infinite loop in the Decompiler for your undecompilable version.  Strangely enough it has nothing to do with the code you modify. It has to do with the middle ifTrue: of the three at the end of the final block:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">                   mm1 eventHandler<br>                                         ifNotNil: [(morphs includesAllOf: mm1 eventHandler allRecipients)<br>                                                     ifTrue: [mm1 eventHandler: nil]].<br>                                   <b>mm1 isMorphicModel<br>                                       ifTrue: [mm1 model isMorphicModel<br>                                                     ifTrue: [mm1 model breakDependents]].</b><br>                             mm1 isTextMorph<br>                                   ifTrue: [mm1 setContainer: nil]]].<br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I can fix it for this one method, but not without breaking decompilation of about 40 other methods.  So I need to understand it better.  Give me a few days.  I've called on a higher power (the original author is Dan himself). So hopefully we'll get this sorted very soon.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jan 8, 2023 at 7:01 PM Florin Mateoc <<a href="mailto:florin.mateoc@gmail.com">florin.mateoc@gmail.com</a>> wrote:<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>Hi,</div><div><br></div><div>Happy New Year everybody!</div><div><br></div><div>I hope you will forgive my transgression, I know this is not about the VM, it is about the bytecode compiler, but I am only subscribed to this list, and the Squeak compiler is somewhere in between.</div><div><br></div><div>I have recently stumbled upon a regression introduced by Compiler-eem.483</div><div>One of my generated (transformed) methods is apparently valid Smalltalk - it can still be compiled - but it cannot be decompiled anymore. I am not sure if this is a compiler bug, or a latent decompiler bug exposed by the changes in
Compiler-eem.483 <br></div><div><br></div><div>My method is below, it is a transformed variant of NativeImageSegment>>findRogueRootsPrep<br></div><div><br></div><div>The bug is somehow caused by the literal #Marker. I have started at the bytecodes and they look ok to me, but the decompiler enters an (apparently unrelated) infinite loop. It is also not just about the literal itself or the immediate surrounding code, the method needs to be big/complex enough (over a certain number of literals?) to trigger the bug.<br></div><div><br></div><div><br></div><div>findRogueRootsPrep1<br>     "Part of the tool to track down unwanted pointers into the segment.  Break all owner pointers in submorphs, scripts, and viewers in flaps."<br>    | wld players morphs |<br>        wld := arrayOfRoots detect: [:obj | obj isMorph and: [obj isWorldMorph]] ifNone: [].<br>  wld == nil ifTrue: [</div><div>  (wld := arrayOfRoots<br>    detect: [:obj1 | obj1 isMorph]<br>    ifNone: [#Marker]</div><div>  ) == #Marker ifTrue: [</div><div>    ^ self error: 'can''t find a root morph']].<br>      morphs := IdentitySet new: 400.<br>       wld allMorphsAndBookPagesInto: morphs.<br>        players := wld presenter allExtantPlayers. "just the cached list"<br>   players do: [:pp | | scriptEditors |<br>  scriptEditors := pp class tileScriptNames collect: [:nn | pp scriptEditorFor: nn].<br>  scriptEditors do: [:se | morphs addAll: se allMorphs]].<br>       wld submorphs do: [:mm | "non showing flaps"<br>  (mm isKindOf: FlapTab) ifTrue: [</div><div>    mm referent allMorphsAndBookPagesInto: morphs]].<br>morphs do: [:mm1 | "break the back pointers"<br>  mm1 isInMemory ifTrue: [</div><div>    (mm1 respondsTo: #target) ifTrue: [</div><div>      mm1 nearestOwnerThat: [:ow | | zzzTemp |<br>        ow == mm1 target ifTrue: [</div><div>          mm1 target: nil.<br>          zzzTemp := true<br>        ] ifFalse: [</div><div>          zzzTemp := false].<br>        zzzTemp]].<br>    (mm1 respondsTo: #arguments) ifTrue: [</div><div>      mm1 arguments do: [:arg | <br></div><div>        arg == nil ifFalse: [</div><div>          mm1 nearestOwnerThat: [:ow1 | | zzzTemp1 |<br>            ow1 == arg ifTrue: [</div><div>              mm1 arguments at: (mm1 arguments indexOf: arg) put: nil.<br>              zzzTemp1 := true<br>            ] ifFalse: [</div><div>              zzzTemp1 := false].<br>            zzzTemp1]]]].<br>    mm1 eventHandler == nil ifFalse: ["recipients point back up"<br>      (morphs includesAllOf: mm1 eventHandler allRecipients) ifTrue: [</div><div>        mm1 eventHandler: nil]].<br>    "temporary, until using Model for PartsBin"<br>    mm1 isMorphicModel ifTrue: [</div><div>      mm1 model isMorphicModel ifTrue: [</div><div>        mm1 model breakDependents]].<br>    mm1 isTextMorph ifTrue: [</div><div>      mm1 setContainer: nil]]].<br>        (Smalltalk includesKey: #Owners) ifTrue: [</div><div>  Smalltalk at: #Owners put: nil].<br>      "in case findOwnerMap: is commented out"<br>    "self findOwnerMap: morphs."<br>        morphs do: [:mm2 | "break the back pointers"<br>  mm2 isInMemory ifTrue: [</div><div>    mm2 privateOwner: nil]]</div><div><br></div><div><br></div><div>Florin<br></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</span></div></blockquote></blockquote></div></body></html>