diff options
author | John Hodge <tpg@mutabah.net> | 2016-08-14 11:01:28 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-08-14 11:01:28 +0800 |
commit | 804131d8c57d11cc58f9be6b6b11d1a547c619f6 (patch) | |
tree | a8d19b661f964265f519f83af372bf4f82f18ef1 /src | |
parent | 4bf1736f80f71095f471531e396de34b98c77c82 (diff) | |
download | mrust-804131d8c57d11cc58f9be6b6b11d1a547c619f6.tar.gz |
MIR Gen Match - Fixes for a small edge case
Diffstat (limited to 'src')
-rw-r--r-- | src/mir/from_hir_match.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mir/from_hir_match.cpp b/src/mir/from_hir_match.cpp index b25584c7..029f00d9 100644 --- a/src/mir/from_hir_match.cpp +++ b/src/mir/from_hir_match.cpp @@ -1551,6 +1551,7 @@ void DecisionTreeNode::propagate_default() if( be->m_default.is_Unset() ) { be->unify_from(def); } + be->propagate_default(); ) } }; @@ -1793,7 +1794,14 @@ void DecisionTreeGen::generate_tree_code( { TRACE_FUNCTION_F("ty=" << ty << ", ty_ofs=" << ty_ofs << ", depth="<<depth<<", node=" << node); + #if 1 + if( depth > node.m_field_path.size() ) { + and_then(node); + return ; + } + #else assert( depth <= node.m_field_path.size() ); + #endif TU_MATCHA( (ty.m_data), (e), (Infer, BUG(sp, "Ivar for in match type"); ), |