Skip to content

Commit f9b37c7

Browse files
committed
Run cleanups in reverse order. Not presently observable, no dtors.
1 parent 7ab8a59 commit f9b37c7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/comp/middle/trans.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3145,7 +3145,10 @@ fn trans_block_cleanups(@block_ctxt cx,
31453145
check (_vec.len[cleanup](cleanup_cx.cleanups) == 0u);
31463146
}
31473147

3148-
for (cleanup c in cleanup_cx.cleanups) {
3148+
auto i = _vec.len[cleanup](cleanup_cx.cleanups);
3149+
while (i > 0u) {
3150+
i -= 1u;
3151+
auto c = cleanup_cx.cleanups.(i);
31493152
alt (c) {
31503153
case (clean(?cfn)) {
31513154
bcx = cfn(bcx).bcx;

0 commit comments

Comments
 (0)