Bug 44498

GemStone/S

6.7.2.1, 6.7.2, 6.7.1, 6.7, 6.6.5, 6.6.4, 6.6.3.3, 6.6.3.2, 6.6.3, 6.6.2, 6.6.1, 6.6, 6.5.8, 6.5.7.5, 6.5.7, 6.5.6, 6.5.5, 6.5.4, 6.5.3, 6.5.2, 6.5.1, 6.5, 6.3.1, 6.2.x, 6.1.6, 6.1.5, 6.1.x

Nested block variable resolution with to:do: may be incorrect

The resolution of variables in nested blocks is not correct in some cases involving to:do: optimizations.

For example, the following code returns #(nil, nil, nil, 4); the correct result is #(1 2 3 4).

  | a b |
  a := Array new: 4.
  b := Array new: 4.
  1 to: a size do: [:i |
          b at: i put: [10 timesRepeat: [a at: i put: i]]
  ].
  1 to: b size do: [:j | (b at: j) value].
  a


                

Last updated: 7/29/14