Mark the exit of infinite loops as unreachable

This commit is contained in:
Jakub Wieczorek 2014-06-04 18:24:58 +02:00
parent d130acc0d0
commit 6d3e89e33c
1 changed files with 4 additions and 0 deletions

View File

@ -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;
}