aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-07-12 21:09:34 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-07-13 02:14:02 +0800
commitd4dfd2869402a2559ea720e4e3800d42b0f90221 (patch)
tree188586069be71ab99d0da17a4b8d6fbd5abd42cb /libsolidity
parent5d8a8f726555361a78dac05a5413558f3f63f7f1 (diff)
downloaddexon-solidity-d4dfd2869402a2559ea720e4e3800d42b0f90221.tar.gz
dexon-solidity-d4dfd2869402a2559ea720e4e3800d42b0f90221.tar.zst
dexon-solidity-d4dfd2869402a2559ea720e4e3800d42b0f90221.zip
Consider fixed size array members when checking for recursive structs.
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index 8ea0a4d7..9d7625c4 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -607,6 +607,12 @@ bool TypeChecker::visit(StructDefinition const& _struct)
auto const& typeName = dynamic_cast<UserDefinedTypeName const&>(*member->typeName());
check(&dynamic_cast<StructDefinition const&>(*typeName.annotation().referencedDeclaration), parents);
}
+ else if (auto arrayType = dynamic_cast<ArrayType const*>(type(*member).get()))
+ {
+ if (!arrayType->isDynamicallySized())
+ if (auto structType = dynamic_cast<StructType const*>(arrayType->baseType().get()))
+ check(&structType->structDefinition(), parents);
+ }
};
check(&_struct, StructPointersSet{});