Mantis - Squeak
Viewing Issue Advanced Details
4313 Compiler major always 07-22-06 23:18 02-06-11 23:48
nicolas cellier  
closed 3.9  
none trunk  
0004313: Compiler+Decompiler together have a serious 'bad case' bug
In Decompiler there is a situation which raises an error, located in #send:super:numargs.

When this erros occurs the emergency console comes up because the debugger fails because the decompiler fails because something else fails (dunno what). Unfortunately, emergency situations are almost impossible to debug, so I can't attach any further information :(

The situation can be reproduced by evaluating the following innocent looking snippet, took quite some time to find it </phew> :

| x y |
 x := y := 0.
{'a'. 'b'. 'c'} do: [:c|
    (c string halt; endsWith: 'd')
        ifTrue: [x:= 1 + x]
        ifFalse: [y:= 1 + y]]

Checked in 3.8 and 3.9, same result.
 decompileCascade-bf.1.cs.gz [^] (864 bytes) 07-23-06 16:16

07-23-06 16:08   
Simpler test case:

test: a
    (a foo; bar)
        ifTrue: [1]
        ifFalse: [2]

If the receiver of an ifTrue:ifFalse: is a cascade, the decompiler mistakes it for a case statement.
07-23-06 16:16   
Attached proposed fix.
07-23-06 23:24   
The proposed fix works for the two examples. Is there a routine for checking the modified Decompiler against all source coded methods?
nicolas cellier   
09-07-10 19:53   
In 4.2 trunk, Decompiler still fails with Klaus example.
Consequences are not catastrophic though.
Bert example works.
nicolas cellier   
09-07-10 21:49   
Oops; my mistake, both issues are fixed in latest 4.2 trunk and probably in 4.1 too