aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-02-12 00:10:35 +0800
committerchriseth <c@ethdev.com>2016-02-12 00:12:30 +0800
commit4a837169c5163f32ac05716c927ecd87e18618bc (patch)
treee73e52cc423ed021e32bd89eb5f52c0ba77b6d0b /libsolidity
parent23074150f439d11fe37e2da3c032aa44cee24d15 (diff)
downloaddexon-solidity-4a837169c5163f32ac05716c927ecd87e18618bc.tar.gz
dexon-solidity-4a837169c5163f32ac05716c927ecd87e18618bc.tar.zst
dexon-solidity-4a837169c5163f32ac05716c927ecd87e18618bc.zip
Fix segfault when using wrong number of constructor arguments.
Diffstat (limited to 'libsolidity')
-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 756f0e4f..857d5530 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -504,6 +504,7 @@ void TypeChecker::visitManually(
return;
}
if (parameters->size() != arguments.size())
+ {
typeError(
_modifier.location(),
"Wrong argument count for modifier invocation: " +
@@ -512,6 +513,8 @@ void TypeChecker::visitManually(
toString(parameters->size()) +
"."
);
+ return;
+ }
for (size_t i = 0; i < _modifier.arguments().size(); ++i)
if (!type(*arguments[i])->isImplicitlyConvertibleTo(*type(*(*parameters)[i])))
typeError(