chiark / gitweb /
lowering: Get state transition right for non-heavy targets
We would go into state B if we found any target. But that's not
right: the chart says to disregard heavy targets, and indeed we don't
want to stack other things below them.
This can lead q_z_top legitimately being null on exit from the walk
loop, if there are no pieces in B or Z. We still need a q_z_top: we
can't leave it open, because we want to make sure we only lower
pieces, not raise them. So we choose the lowest piece in Q, or,
failing that, P.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>