aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-10-16 21:20:44 +0800
committerchriseth <c@ethdev.com>2015-10-16 21:20:44 +0800
commit452d4732937f418d9c0b5152050c13aa48b7fdde (patch)
tree1299ef98d48c98f630f1a3828929075fc3ea48fe /libsolidity
parent102114176ce175e7cb937016ed30a45c8dc720d6 (diff)
parentead0478f268f486ea8e9eccac729c93cf4a94ee1 (diff)
downloaddexon-solidity-452d4732937f418d9c0b5152050c13aa48b7fdde.tar.gz
dexon-solidity-452d4732937f418d9c0b5152050c13aa48b7fdde.tar.zst
dexon-solidity-452d4732937f418d9c0b5152050c13aa48b7fdde.zip
Merge pull request #143 from chriseth/loneStructArray
Fix errors when struct array type is used on its own.
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/ExpressionCompiler.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/libsolidity/ExpressionCompiler.cpp b/libsolidity/ExpressionCompiler.cpp
index fde88a00..112521f9 100644
--- a/libsolidity/ExpressionCompiler.cpp
+++ b/libsolidity/ExpressionCompiler.cpp
@@ -950,6 +950,12 @@ bool ExpressionCompiler::visit(IndexAccess const& _indexAccess)
break;
}
}
+ else if (baseType.category() == Type::Category::TypeType)
+ {
+ solAssert(baseType.sizeOnStack() == 0, "");
+ solAssert(_indexAccess.annotation().type->sizeOnStack() == 0, "");
+ // no-op - this seems to be a lone array type (`structType[];`)
+ }
else
solAssert(false, "Index access only allowed for mappings or arrays.");
@@ -1003,6 +1009,10 @@ void ExpressionCompiler::endVisit(Identifier const& _identifier)
{
// no-op
}
+ else if (dynamic_cast<StructDefinition const*>(declaration))
+ {
+ // no-op
+ }
else
{
BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Identifier type not expected in expression context."));