Whilst running the SUnit suite I got a _really_ puzzling failure (amongst the less puzzling failures) where it seems like the Compiler is broken.
Somewhere in the suite, TTFontReader>processHorizontalMetricsTable:length: is decompiled and recompiled. In the process the code is broken.
Original as written by Andreas:- processHorizontalMetricsTable: entry length: numHMetrics "Extract the advance width, left side bearing, and right side bearing for each glyph from the Horizontal Metrics Table." | index lastAW glyph | index _ 1. [index <= numHMetrics] whileTrue:[ glyph _ glyphs at: index. glyph advanceWidth: entry nextUShort. glyph leftSideBearing: entry nextShort. glyph updateRightSideBearing. index _ index + 1]. index = (nGlyphs +1) ifTrue:[^true]. lastAW _ (glyphs at: index-1) advanceWidth.
[index <= nGlyphs] whileTrue:[ glyph _ glyphs at: index. glyph advanceWidth: lastAW. glyph leftSideBearing: entry nextShort. glyph updateRightSideBearing. index _ index + 1].
as complained about in a SyntaxError notifier processHorizontalMetricsTable: t1 length: t2 | t4 t5 t3| 1 to: t2 do: [:t3 | t5 := glyphs at: t3. t5 advanceWidth: t1 nextUShort. t5 leftSideBearing: t1 nextShort. t5 updateRightSideBearing]. t3 = (nGlyphs + 1) ifTrue: [^ true]. t4 := (glyphs at: t3 - 1) advanceWidth. [t3 <= nGlyphs] whileTrue: [t5 := glyphs at: t3. t5 advanceWidth: t4. t5 leftSideBearing: t1 nextShort. t5 updateRightSideBearing. t3 := t3 + 1]
which is a) broken because t3 is out of scope after the first block and b) not teribly like the original.
I'm not convinced a transform that produces broken code is a very good transform...
tim -- Tim Rowledge, tim@sumeru.stanford.edu, http://sumeru.stanford.edu/tim Portable: Survives system reboot.
Am 01.12.2004 um 01:44 schrieb Tim Rowledge:
Whilst running the SUnit suite I got a _really_ puzzling failure (amongst the less puzzling failures) where it seems like the Compiler is broken.
The decompiler tests havn't been run for a long time (Stef only recently converted the dead code from SystemDictionary into a living test).
So this bug has been there for some time I guess.
The DecompilerTest even has a list of known failing methods, it could be that this just isn't there because it's not part of the basic image.
Marcus
squeak-dev@lists.squeakfoundation.org