@@ -1223,7 +1223,7 @@ pub fn simple_block_scope(parent: Option<@mut ScopeInfo>,
1223
1223
loop_break : None ,
1224
1224
loop_label : None ,
1225
1225
cleanups : RefCell :: new ( ~[ ] ) ,
1226
- cleanup_paths : ~[ ] ,
1226
+ cleanup_paths : RefCell :: new ( ~[ ] ) ,
1227
1227
landing_pad : None ,
1228
1228
node_info : node_info,
1229
1229
}
@@ -1253,7 +1253,7 @@ pub fn loop_scope_block(bcx: @Block,
1253
1253
loop_break : Some ( loop_break) ,
1254
1254
loop_label : loop_label,
1255
1255
cleanups : RefCell :: new ( ~[ ] ) ,
1256
- cleanup_paths : ~[ ] ,
1256
+ cleanup_paths : RefCell :: new ( ~[ ] ) ,
1257
1257
landing_pad : None ,
1258
1258
node_info : opt_node_info,
1259
1259
} ) , bcx. is_lpad , n, opt_node_info) ;
@@ -1333,7 +1333,12 @@ pub fn cleanup_and_leave(bcx: @Block,
1333
1333
let mut skip = 0 ;
1334
1334
let mut dest = None ;
1335
1335
{
1336
- let r = ( * inf) . cleanup_paths . rev_iter ( ) . find ( |cp| cp. target == leave) ;
1336
+ let cleanup_paths = inf. cleanup_paths . borrow ( ) ;
1337
+ let r = cleanup_paths. get ( )
1338
+ . rev_iter ( )
1339
+ . find ( |cp| {
1340
+ cp. target == leave
1341
+ } ) ;
1337
1342
for cp in r. iter ( ) {
1338
1343
let cleanups = inf. cleanups . borrow ( ) ;
1339
1344
if cp. size == cleanups. get ( ) . len ( ) {
@@ -1348,7 +1353,9 @@ pub fn cleanup_and_leave(bcx: @Block,
1348
1353
let sub_cx = sub_block ( bcx, "cleanup" ) ;
1349
1354
Br ( bcx, sub_cx. llbb ) ;
1350
1355
let cleanups = inf. cleanups . borrow ( ) ;
1351
- inf. cleanup_paths . push ( cleanup_path {
1356
+ let mut cleanup_paths = inf. cleanup_paths
1357
+ . borrow_mut ( ) ;
1358
+ cleanup_paths. get ( ) . push ( cleanup_path {
1352
1359
target : leave,
1353
1360
size : cleanups. get ( ) . len ( ) ,
1354
1361
dest : sub_cx. llbb
0 commit comments