Local vars should be bound to their compound statement they are used.
ILHolder can simply count up an id whenever the compound list is consumed.
If the transformer encounters a local var it should check, if the var id is already bound to another compound list (and therefore is out of scope).
Very important if for loops initialize i twice. The seconds for loop could use the previous i if the scope/compound membership is not checked.
Local vars should be bound to their compound statement they are used.
ILHolder
can simply count up an id whenever the compound list is consumed. If the transformer encounters a local var it should check, if the var id is already bound to another compound list (and therefore is out of scope).Very important if for loops initialize
i
twice. The seconds for loop could use the previousi
if the scope/compound membership is not checked.