From 4a837169c5163f32ac05716c927ecd87e18618bc Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 11 Feb 2016 17:10:35 +0100 Subject: [PATCH] Fix segfault when using wrong number of constructor arguments. --- libsolidity/analysis/TypeChecker.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 756f0e4f4..857d55303 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(