Mantis - Squeak
Viewing Issue Advanced Details
2151 Compiler crash always 11-03-05 11:48 07-14-06 21:18
kwl  
MarcusDenker  
normal  
closed 3.9  
fixed  
none    
none 3.9  
0002151: Max number of literals checked in MethodNode instead of CompiledMethod
The maximum number of literals (currently 255) is checked in MethodNode>>#generate: instead of CompiledMethod>>#newBytes:trailerBytes:nArgs:nTemps:nStack:nLits:primitive:

This can result in corrupted method header and VM crash when CompiledMethod is not generated from MethodNode (for example when instrumenting methods without recompiling them).
Same situation in 3.8 and 3.7 (didn't check older releases).
 cmNumLitCheck-md.1.cs [^] (2,596 bytes) 02-25-06 17:52

Notes
(0004088)
MarcusDenker   
02-25-06 17:53   
changeset attached
(0004175)
MarcusDenker   
02-27-06 23:47   
7004
(0005372)
kwl   
06-25-06 10:13   
The maximum number of temps (nTemps, incl. nArgs) is checked for not exceeding 64 in
newBytes:trailerBytes:nArgs:nTemps:nStack:nLits:primitive:
newBytes:trailerBytes:nArgs:nTemps:nStack:nLits:primitive:flag:

But the number of bits allocated for encoding nTemps in a CompiledMethod header are 6 and so the check must be for nTemps not exceeding 63.

This is not easy to find since the class comment does not speak about nTemps includes nArgs or not. So I have also checked senders of #newMethod:header: and Interpreter>>#tempCountOf: and this one does bitAnd: 16r3F.

I'm sorry this wasn't seen earlier.
(0005907)
MarcusDenker   
07-14-06 21:18   
7045