This is, of course, the classic Go for loop hazard where a closure in the
loop captures the symbol itself rather than the value of the symbol, and
the symbol gets modified directly on each iteration so all of the closures
end up referring to whichever value came last.
This is just an ugly tactical fix for that intentionally not changing the
existing code too much. Hopefully in a future commit we'll rearrange this
a little so that it's harder to accidentally reintroduce this bug later,
and we should also add some more complex test cases with multiple embedded
stack calls and multiple component calls.