From f5b184323d73693b7445419e1b97cb43c15fd426 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 9 Dec 2015 17:37:19 +0100 Subject: Fix: Type checker crash for wrong number of base constructor arguments. --- libsolidity/analysis/TypeChecker.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libsolidity') 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])) -- cgit