summaryrefslogtreecommitdiff
path: root/src/mir/from_hir.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-08-12 15:33:44 +0800
committerJohn Hodge <tpg@mutabah.net>2016-08-12 15:33:44 +0800
commit6121ffe191f1f921eef8066d0ab5734bdae416a3 (patch)
treef62e977e9251bc60e8566ad9dacf2552dafaadc0 /src/mir/from_hir.cpp
parent1ef94e6f5e6255fad4c6b8e9a351aa1f51dd8b0d (diff)
downloadmrust-6121ffe191f1f921eef8066d0ab5734bdae416a3.tar.gz
MIR Gen - Handle false branch of if diverging
Diffstat (limited to 'src/mir/from_hir.cpp')
-rw-r--r--src/mir/from_hir.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mir/from_hir.cpp b/src/mir/from_hir.cpp
index d51f479d..e6203982 100644
--- a/src/mir/from_hir.cpp
+++ b/src/mir/from_hir.cpp
@@ -276,8 +276,11 @@ namespace {
if( node.m_false )
{
this->visit_node_ptr(node.m_false);
- m_builder.push_stmt_assign( result_val.clone(), m_builder.get_result(node.m_false->span()) );
- m_builder.end_block( ::MIR::Terminator::make_Goto(next_block) );
+ if( m_builder.block_active() )
+ {
+ m_builder.push_stmt_assign( result_val.clone(), m_builder.get_result(node.m_false->span()) );
+ m_builder.end_block( ::MIR::Terminator::make_Goto(next_block) );
+ }
}
else
{