[squeak-dev] Re: Bug in BytecodeGenerator>>#jump:if:

Klaus D. Witzel klaus.witzel at cobss.com
Sun Jun 22 16:02:27 UTC 2008

On Sun, 22 Jun 2008 17:16:37 +0200, Nicolas wrote:

> So what would you assert about longJumpIfFalseTest?


> We could assert that trying to compile such a method should raise an  
> Exception (let's say a ByteCodeLimitException).

No, I wouldn't do that. I'd wrap the instance of CompiledMethod into an  
InstructionStream using temps | is msg | and check it on the meta level,  
without executing the method and without the possibility that this crashes  
the VM, like

  (msg := is nextInstruction) selector == #pushConstant: and: [msg  
arguments = #(true)].
  (msg := is nextInstruction) selector == #jump:if: and:  [msg arguments =  
#(offset false)]

where offset is the one expected.


More information about the Squeak-dev mailing list