aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis
diff options
context:
space:
mode:
authorFederico Bond <federicobond@gmail.com>2018-02-12 06:44:23 +0800
committerFederico Bond <federicobond@gmail.com>2018-02-12 08:40:41 +0800
commit75a3a707a243ccb6135c7931bb32ac7b44551082 (patch)
tree435af7721119cf12f952890e280e48d380a5510f /libsolidity/analysis
parent2095e7a32dce04f6142074bf96f14b6c7046137a (diff)
downloaddexon-solidity-75a3a707a243ccb6135c7931bb32ac7b44551082.tar.gz
dexon-solidity-75a3a707a243ccb6135c7931bb32ac7b44551082.tar.zst
dexon-solidity-75a3a707a243ccb6135c7931bb32ac7b44551082.zip
Fix segfault with undeclared array types
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r--libsolidity/analysis/ReferencesResolver.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/libsolidity/analysis/ReferencesResolver.cpp b/libsolidity/analysis/ReferencesResolver.cpp
index 30b06615..451d6c93 100644
--- a/libsolidity/analysis/ReferencesResolver.cpp
+++ b/libsolidity/analysis/ReferencesResolver.cpp
@@ -153,6 +153,11 @@ void ReferencesResolver::endVisit(Mapping const& _typeName)
void ReferencesResolver::endVisit(ArrayTypeName const& _typeName)
{
TypePointer baseType = _typeName.baseType().annotation().type;
+ if (!baseType)
+ {
+ solAssert(!m_errorReporter.errors().empty(), "");
+ return;
+ }
if (baseType->storageBytes() == 0)
fatalTypeError(_typeName.baseType().location(), "Illegal base type of storage size zero for array.");
if (Expression const* length = _typeName.length())