File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -504,6 +504,7 @@ void TypeChecker::visitManually(
504
504
return ;
505
505
}
506
506
if (parameters->size () != arguments.size ())
507
+ {
507
508
typeError (
508
509
_modifier.location (),
509
510
" Wrong argument count for modifier invocation: " +
@@ -512,6 +513,8 @@ void TypeChecker::visitManually(
512
513
toString (parameters->size ()) +
513
514
" ."
514
515
);
516
+ return ;
517
+ }
515
518
for (size_t i = 0 ; i < _modifier.arguments ().size (); ++i)
516
519
if (!type (*arguments[i])->isImplicitlyConvertibleTo (*type (*(*parameters)[i])))
517
520
typeError (
Original file line number Diff line number Diff line change @@ -3136,6 +3136,21 @@ BOOST_AUTO_TEST_CASE(conditional_with_all_types)
3136
3136
BOOST_CHECK (success (text));
3137
3137
}
3138
3138
3139
+ BOOST_AUTO_TEST_CASE (constructor_call_invalid_arg_count)
3140
+ {
3141
+ // This caused a segfault in an earlier version
3142
+ char const * text = R"(
3143
+ contract C {
3144
+ function C(){}
3145
+ }
3146
+ contract D is C {
3147
+ function D() C(5){}
3148
+ }
3149
+ )" ;
3150
+
3151
+ BOOST_CHECK (expectError (text) == Error::Type::TypeError);
3152
+ }
3153
+
3139
3154
BOOST_AUTO_TEST_CASE (index_access_for_bytes)
3140
3155
{
3141
3156
char const * text = R"(
You can’t perform that action at this time.
0 commit comments