diff options
author | John Hodge <tpg@mutabah.net> | 2016-07-12 18:16:56 +1000 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-07-12 18:16:56 +1000 |
commit | 3cf94484ee909a1f84a8c93074b1bf7d96c70f5c (patch) | |
tree | 430b0ea4b439bc80d8a68da6a3cefc44770da8a6 /src | |
parent | 5def65d31b8319ccf2e375c0b9f6cf1f221b051f (diff) | |
download | mrust-3cf94484ee909a1f84a8c93074b1bf7d96c70f5c.tar.gz |
HIR Typecheck - Don't attempt to typecheck nullptr array sizes
Diffstat (limited to 'src')
-rw-r--r-- | src/hir_typeck/expr_visit.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/hir_typeck/expr_visit.cpp b/src/hir_typeck/expr_visit.cpp index 1be9f7f8..11705a7e 100644 --- a/src/hir_typeck/expr_visit.cpp +++ b/src/hir_typeck/expr_visit.cpp @@ -78,7 +78,9 @@ namespace { this->visit_type( *e.inner ); DEBUG("Array size " << ty); t_args tmp; - Typecheck_Code( m_ms, tmp, ::HIR::TypeRef(::HIR::CoreType::Usize), e.size ); + if( e.size ) { + Typecheck_Code( m_ms, tmp, ::HIR::TypeRef(::HIR::CoreType::Usize), e.size ); + } ) else { ::HIR::Visitor::visit_type(ty); |