[squeak-dev] Re: Bug in BytecodeGenerator>>#jump:if:
Klaus D. Witzel
klaus.witzel at cobss.com
Sun Jun 22 14:43:00 UTC 2008
On Sun, 22 Jun 2008 16:05:57 +0200, Nicolas wrote:
> 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...
>>
>
> Just for the fun of it: how do you write non regression tests for such
> ones?
>
> self shouldnt: [SmalltalkImage crash] ???
You might want to check the CompiledMethod of the following method (the
bytecode which in my .image has offset 34):
!UndefinedObject methodsFor: 'as yet unclassified' stamp: 'kwl 6/22/2008
16:37'!
longJumpIfFalseTest
"(nil class>>#longJumpIfFalseTest) inspect"
true ifTrue:[
{42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42.
42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42.
42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42.
42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42.
42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42.
42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42.
42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42.
42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42.
42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42.
42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42.
42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42.
42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42.
42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42.
42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42.
42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42.
42. 42. 42. 42. 42. 42
}
]! !
/Klaus
>
More information about the Squeak-dev
mailing list
|