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

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


I've encountered a bug in BytecodeGenerator>>#jump:if:

See the message below and bug report at
http://bugs.squeak.org/view.php?id=7100

André

-------- Original-Nachricht --------
Betreff: [squeak-dev] Bug in BytecodeGenerator>>#jump:if:
Datum: Sun, 22 Jun 2008 12:54:32 +0200
Von: André Wendt <andre.wendt at hpi.uni-potsdam.de>
Antwort an: The general-purpose Squeak developers list
<squeak-dev at lists.squeakfoundation.org>
An: squeak-dev at lists.squeakfoundation.org

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é

-------------- next part --------------
A non-text attachment was scrubbed...
Name: BytecodeGenerator.awe.1.cs
Type: text/x-csharp
Size: 831 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/newcompiler/attachments/20080622/0afad839/BytecodeGenerator.awe.1.bin


More information about the Newcompiler mailing list