aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-12-10 22:48:48 +0800
committerchriseth <c@ethdev.com>2015-12-10 22:48:48 +0800
commit251e7aa462110b50095a8cf2508a0167df6be55d (patch)
tree0d74f5bfae83e4e2893151108d10c467e71938cf /libsolidity/analysis
parent08cb74a1de1d32168e2b7ef988180896861192e0 (diff)
parentf5b184323d73693b7445419e1b97cb43c15fd426 (diff)
downloaddexon-solidity-251e7aa462110b50095a8cf2508a0167df6be55d.tar.gz
dexon-solidity-251e7aa462110b50095a8cf2508a0167df6be55d.tar.zst
dexon-solidity-251e7aa462110b50095a8cf2508a0167df6be55d.zip
Merge pull request #289 from chriseth/fix_base_constructor_params
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 425f9299..01de5eb0 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]))