Run cleanups in reverse order. Not presently observable, no dtors.

This commit is contained in:
Graydon Hoare 2011-01-31 12:06:27 -08:00
parent 7ab8a5904d
commit f9b37c7348

View File

@ -3145,7 +3145,10 @@ fn trans_block_cleanups(@block_ctxt cx,
check (_vec.len[cleanup](cleanup_cx.cleanups) == 0u);
}
for (cleanup c in cleanup_cx.cleanups) {
auto i = _vec.len[cleanup](cleanup_cx.cleanups);
while (i > 0u) {
i -= 1u;
auto c = cleanup_cx.cleanups.(i);
alt (c) {
case (clean(?cfn)) {
bcx = cfn(bcx).bcx;