@@ -215,10 +215,10 @@ fn find_pre_post_state_expr(&fn_ctxt fcx, &prestate pres, @expr e) -> bool {
215
215
auto changed = false ;
216
216
auto num_local_vars = num_locals ( fcx. enclosing ) ;
217
217
218
- /*
218
+ /*
219
219
log_err("states:");
220
220
log_expr_err(*e);
221
- log_err(middle::ty::expr_ann(e).id );
221
+ aux::log_bitv_err(fcx, expr_poststate(fcx.ccx, e) );
222
222
*/
223
223
224
224
/* FIXME could get rid of some of the copy/paste */
@@ -236,10 +236,12 @@ fn find_pre_post_state_expr(&fn_ctxt fcx, &prestate pres, @expr e) -> bool {
236
236
/* rands go left-to-right */
237
237
changed = find_pre_post_state_exprs ( fcx,
238
238
expr_poststate ( fcx. ccx , operator) , a, operands) || changed;
239
- /* if this is a failing call, it sets the return value */
239
+ /* if this is a failing call, it sets everything as initialized */
240
240
alt ( controlflow_expr ( fcx. ccx , operator) ) {
241
241
case ( noreturn) {
242
- changed = gen_poststate ( fcx, a, fcx. id ) || changed;
242
+ changed = set_poststate_ann ( fcx. ccx , a,
243
+ false_postcond ( num_local_vars) )
244
+ || changed;
243
245
}
244
246
case ( _) { }
245
247
}
@@ -525,16 +527,17 @@ fn find_pre_post_state_expr(&fn_ctxt fcx, &prestate pres, @expr e) -> bool {
525
527
for ( arm an_alt in alts) {
526
528
changed = find_pre_post_state_block ( fcx, e_post,
527
529
an_alt. block ) || changed;
528
- changed = intersect ( a_post,
529
- block_poststate ( fcx. ccx ,
530
- an_alt. block ) ) || changed;
530
+ intersect ( a_post, block_poststate ( fcx. ccx , an_alt. block ) ) ;
531
+ // We deliberately do *not* update changed here, because we'd
532
+ // go into an infinite loop that way, and the change gets made
533
+ // after the if expression.
531
534
}
532
535
}
533
536
else {
534
537
// No alts; poststate is the poststate of the test
535
538
a_post = e_post;
536
539
}
537
- changed = extend_poststate_ann ( fcx. ccx , a, a_post) ;
540
+ changed = extend_poststate_ann ( fcx. ccx , a, a_post) || changed ;
538
541
ret changed;
539
542
}
540
543
case ( expr_field ( ?e, _, ?a) ) {
0 commit comments