Skip to content

Commit

Permalink
Mark the exit of infinite loops as unreachable
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Wieczorek committed Jun 4, 2014
1 parent d130acc commit 6d3e89e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/librustc/middle/trans/controlflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ pub fn trans_loop<'a>(bcx:&'a Block<'a>,

fcx.pop_loop_cleanup_scope(loop_id);

if ty::type_is_bot(node_id_type(bcx, loop_id)) {
Unreachable(next_bcx_in);
}

return next_bcx_in;
}

Expand Down

0 comments on commit 6d3e89e

Please sign in to comment.