aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-02-12 00:10:00 +0800
committerchriseth <c@ethdev.com>2016-02-12 00:12:28 +0800
commit23074150f439d11fe37e2da3c032aa44cee24d15 (patch)
treee7ee491d19967bd2e2b24379d40e86600f1e7f39
parentc6c3c78327751db3e27458596394ce3533a7fcbc (diff)
downloaddexon-solidity-23074150f439d11fe37e2da3c032aa44cee24d15.tar.gz
dexon-solidity-23074150f439d11fe37e2da3c032aa44cee24d15.tar.zst
dexon-solidity-23074150f439d11fe37e2da3c032aa44cee24d15.zip
Test for segfault when using wrong number of constructor arguments.
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index d202942c..3ca5a6b2 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -3136,6 +3136,21 @@ BOOST_AUTO_TEST_CASE(conditional_with_all_types)
BOOST_CHECK(success(text));
}
+BOOST_AUTO_TEST_CASE(constructor_call_invalid_arg_count)
+{
+ // This caused a segfault in an earlier version
+ char const* text = R"(
+ contract C {
+ function C(){}
+ }
+ contract D is C {
+ function D() C(5){}
+ }
+ )";
+
+ BOOST_CHECK(expectError(text) == Error::Type::TypeError);
+}
+
BOOST_AUTO_TEST_CASE(index_access_for_bytes)
{
char const* text = R"(