Mantis - Squeak
Viewing Issue Advanced Details
7133 Compiler crash always 07-23-08 00:41 02-06-11 23:48
none 4.1  
0007133: CompiledMethod#getSourceFor:In: crashed for non-standard method signatures
If a class refines Behavior#compilerClass with a custom compiler, the method CompiledMethod#getSourceFor:In: will crash because it does not take into account that methods may contain non-standard source code.

In particular it is the piece of code in CompiledMethod#getSourceFor:In: that tries to replace selectors in the source code if they are different that given in the method dictionary.

As a solution I suggest to just not doing any selector-magic when a class has a custom compiler.
To reproduce

1. Subclass Compiler and make it accept methods like 'Foo foo: Bar bar ^bar' (eg by removing all uppercase words from the to be compiler sources).
2. Make a class which uses the new compiler as its compiler.
3. Make a method with above content.
4. compile fine, but ...
5. crashed when IDE calls CompiledMethod#getSourceFor:In:

nicolas cellier   
09-07-10 19:10   
#getSourceFor:in: class changed in trunk 4.1
The new version exploits trailer. Is this problematic ?

Otherwise, subclass can also provide its own #getSourceFor:in:
What do you think ?
11-06-10 06:08   
The old Traits implementation shared methods between traits and classes. If a method was renamed in a class or a trait, then the name was changed in #getSourceFor:in:. Since methods are no longer shared, this problem is solved.