diff options
author | John Hodge <tpg@mutabah.net> | 2016-11-06 14:06:52 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-11-06 14:06:52 +0800 |
commit | 3d3d0a6ddb66f9538e1230681ea48c03931dd418 (patch) | |
tree | 6cbeb944aaa93a25849152fa90bc0f5e9926ff62 | |
parent | a4d7a3d00401a30936854294813022a10684fd0e (diff) | |
download | mrust-3d3d0a6ddb66f9538e1230681ea48c03931dd418.tar.gz |
HIR Consteval - Fix edge case where array inner wasn't expanded correctly
-rw-r--r-- | src/hir_conv/constant_evaluation.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/hir_conv/constant_evaluation.cpp b/src/hir_conv/constant_evaluation.cpp index 463b39ce..311c2f39 100644 --- a/src/hir_conv/constant_evaluation.cpp +++ b/src/hir_conv/constant_evaluation.cpp @@ -1144,8 +1144,9 @@ namespace { void visit_type(::HIR::TypeRef& ty) override { + ::HIR::Visitor::visit_type(ty); + TU_IFLET(::HIR::TypeRef::Data, ty.m_data, Array, e, - ::HIR::Visitor::visit_type(*e.inner); if( e.size_val == ~0u ) { assert(e.size); @@ -1158,9 +1159,6 @@ namespace { } DEBUG("Array " << ty << " - size = " << e.size_val); ) - else { - ::HIR::Visitor::visit_type(ty); - } } void visit_constant(::HIR::ItemPath p, ::HIR::Constant& item) override { |