Mantis - Squeak
Viewing Issue Advanced Details
7161 Compiler tweak always 08-25-08 10:43 01-10-09 02:13
kwl  
 
normal  
@60@  
fixed  
none    
none  
0007161: Compilation nils Undeclared variables unconditionally
when building a script there suddenly ways this situation:

- some methods where compiled, they had Undeclared variables (shown in
Transcript)

- an expression in the script initilized these variables with values ~= nil

- some more methods where compiled, referencing the still undeclared
variables

Bang! the values from the initialization step where nil again :(

- (here the script was aborted because it would never work).

Why are the variables nil'ed again by the compiler, or is it a bug? One
would expect that the compiler touches the values in Undeclared only if
their variables do not already exist. Instead, it nils them time and again.

Example expressions for reproducing the situation (formulated for
non-interactive use, no popups), checked they do the same in 3.10.2, 3.9
and 3.8 stock images:

  (Compiler evaluate: 'YourNameGoesHere := Object new' logged: true)

  (nil class compile: 'methName ^YourNameGoesHere' classified:
#'*YourPackageNameGoesHere')

then inspect Undeclared.
happens in method Encoder>>#undeclared:, fix is attached.
 Encoder-undeclared.kwl.M7161.cs [^] (643 bytes) 08-25-08 10:45

Notes
(0012524)
kwl   
08-25-08 10:47   
uploaded fix
(0012794)
kwl   
11-24-08 08:58   
Encoder>>#undeclared: was been fixed with

 Undeclared at: sym ifAbsentPut: nil.

in the compiler extensions of the new FFI

- http://www.squeaksource.com/Alien.html [^]
(0012809)
Keith_Hodges   
11-26-08 02:49   
"fix begin"
Installer mantis bug: 7161 fix: 'Encoder-undeclared.kwl.M7161.cs'.
"fix end"