[squeak-dev] Re: Bug in BytecodeGenerator>>#jump:if:
nice
ncellier at ifrance.com
Sun Jun 22 13:59:02 UTC 2008
Hello André,
Good find!
I confirm only 4 bytes codes are reserved for longJumpIfFalse and 4
bytes code for longJumpIfTrue.
So this seems like a MAJOR bug. The kind of bug able to crash squeak if
you generate and execute a method with a jump > 1024 and < 2048...
I recommend you post to NewCompiler mailing list, even if not very
active, some members don't listen at squeak-dev.
I recommend you also check latest squeak source Monticello updates for
NewCompiler.
(MCHttpRepository
location: 'http://www.squeaksource.com/NewCompiler'
user: ''
password: '')
Last, I recommend you persist a little bit with Mantis. Creating an
account and posting a bugform should not be that difficult. What is the
problem you encountered with Mantis?
Nicolas
André Wendt wrote:
> Hi all,
>
> apologies if this doesn't belong here. Mantis is a usability-nightmare
> and I didn't know where else to report a bug in the NewCompiler. The
> corresponding ML on squeakfoundation.org hasn't been posted to in over
> six months.
>
> I've noticed that BytecodeGenerator>>#jump:if: has a bug when given a
> distance >= 1024.
>
> It states
>
> hi := distance // 256.
>
> and then goes on checking if hi < 8. If that's false, the jump is
> assumed to be too big. However, the check should be hi < 4.
>
> Assume the method gets an argument of 1024, and hi is 4. The following
>
> self nextPut: (Bytecodes at: #longJumpIfFalse) first + hi.
>
> generates bytecode 176, which is an arithmetic message send instead of a
> conditional jump.
>
> I've attached a changeset that checks both jump conditions for hi < 4.
>
> Regards,
> André
>
>
> ------------------------------------------------------------------------
>
>
More information about the Squeak-dev
mailing list
|