<div dir="ltr"><div>Hi David,</div><div>OK, the variables are initialized conditionally in Cogit>>setInterpreter:</div><div><br></div><div>           BytecodeSetHasDirectedSuperSend ifTrue:<br>                       [directedSuperSendTrampolines := CArrayAccessor on: (Array new: NumSendTrampolines).<br>                   directedSuperBindingSendTrampolines := CArrayAccessor on: (Array new: NumSendTrampolines).<br>                    directedSendUsesBinding := false].</div><div><br></div><div>So maybe it's not the case of Newspeak bytecode set, and maybe these methods won't be used, but it's not a nice way to do it.</div><div>We shall not generate unused incorrect methods, it spoils compiler warning examination...<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le dim. 27 oct. 2019 à 19:58, David T. Lewis <<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</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"> <br>
On Sat, Oct 26, 2019 at 11:45:08PM +0200, Nicolas Cellier wrote:<br>
>  <br>
> Hi all,<br>
> I see what looks like a big problem in those files:<br>
> <a href="https://raw.githubusercontent.com/OpenSmalltalk/opensmalltalk-vm/Cog/nsspur64src/vm/cogitX64SysV.c" rel="noreferrer" target="_blank">https://raw.githubusercontent.com/OpenSmalltalk/opensmalltalk-vm/Cog/nsspur64src/vm/cogitX64SysV.c</a><br>
> <a href="https://raw.githubusercontent.com/OpenSmalltalk/opensmalltalk-vm/Cog/nsspursrc/vm/cogitIA32.c" rel="noreferrer" target="_blank">https://raw.githubusercontent.com/OpenSmalltalk/opensmalltalk-vm/Cog/nsspursrc/vm/cogitIA32.c</a><br>
> <br>
> The generated code for genSendDirectedSuper:numArgs: is bogus.<br>
> the 3 instance variables<br>
> - directedSendUsesBinding<br>
> - directedSuperSendTrampolines<br>
> - directedSuperBindingSendTrampolines<br>
> have been translated into local (thus uninitialized) variables...<br>
> <br>
> How can this possibly work?<br>
> Is it related to the CI failures?<br>
<br>
Very likely the variables are being generated as local because they are<br>
not referenced elsewhere. For example, directedSuperSendTrampolines is<br>
initialized in simulation only by Cogit>>setInterpreter: but apparently<br>
is not set anywhere in the actual translated code.<br>
<br>
I don't think that uninitialized locals are set to null in C, so yes<br>
this could be a source of random behavior in the CI tests.<br>
<br>
A solution would be to initialize the three variables, possibly just<br>
by referencing them explicitly in one of the declareCVarsIn: methods.<br>
<br>
Dave<br>
<br>
</blockquote></div>