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

André Wendt andre.wendt at hpi.uni-potsdam.de
Sun Jun 22 16:03:57 UTC 2008


Hello Nicolas,

nice wrote:
> 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...

Well, not in my case, I was wondering why I got a
True>>doesNotUnderstand: #adaptToNumberAndSend:

The reason was that a send:#+ was generated after a Boolean got pushed.
So no crash, but weird behavior. YMMV.

> I recommend you post to NewCompiler mailing list, even if not very
> active, some members don't listen at squeak-dev.

OK, I'll do that.

> I recommend you also check latest squeak source Monticello updates for
> NewCompiler.
> (MCHttpRepository
>     location: 'http://www.squeaksource.com/NewCompiler'
>     user: ''
>     password: '')

Well, I have confirmed this with NewCompiler-md.281.mcz, there doesn't
semm to be a more recent version on [1].

> 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?

Well, for starters the font is so small it makes my eyes hurt. I know I
can increase it with my browser, but why isn't there a usable default
value? :(

For obvious reasons, I always want to make sure the bug isn't reported
yet before filing it -- but there's no search on the homepage. :(

What kind of "project" does this bug belong to? Why do I have to care?

Oh wait, there it is: "View Issues". I can apply "filters", but why not
a general fuzzy search? A big fat "SEARCH: [__________] [GO]" that
doesn't give me a zillion options would be nice.

Let's put it the marketing way: "There's room for improvement." ;-)

Anyway, I'll forward this to the NewCompiler list and will file a bug in
Mantis.

Regards,
André

[1] http://www.squeaksource.com/NewCompiler/

> 
> 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