aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-12-10 00:37:19 +0800
committerchriseth <c@ethdev.com>2015-12-10 00:37:19 +0800
commitf5b184323d73693b7445419e1b97cb43c15fd426 (patch)
tree740c86392f69c3f9c79052aa1e56c39c9e720ad8 /libsolidity/analysis
parent15a1468c3fcf520b9c8f0af22159ea729cf9f085 (diff)
downloaddexon-solidity-f5b184323d73693b7445419e1b97cb43c15fd426.tar.gz
dexon-solidity-f5b184323d73693b7445419e1b97cb43c15fd426.tar.zst
dexon-solidity-f5b184323d73693b7445419e1b97cb43c15fd426.zip
Fix: Type checker crash for wrong number of base constructor arguments.
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index 851266bd..5bdd169f 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -337,6 +337,7 @@ void TypeChecker::endVisit(InheritanceSpecifier const& _inheritance)
auto const& arguments = _inheritance.arguments();
TypePointers parameterTypes = ContractType(*base).constructorType()->parameterTypes();
if (!arguments.empty() && parameterTypes.size() != arguments.size())
+ {
typeError(
_inheritance.location(),
"Wrong argument count for constructor call: " +
@@ -345,6 +346,8 @@ void TypeChecker::endVisit(InheritanceSpecifier const& _inheritance)
toString(parameterTypes.size()) +
"."
);
+ return;
+ }
for (size_t i = 0; i < arguments.size(); ++i)
if (!type(*arguments[i])->isImplicitlyConvertibleTo(*parameterTypes[i]))