From b8fc58850d9f37c22dedca3ed189f2fdd5458236 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 26 Jul 2017 14:19:32 +0200 Subject: Test for assigning to non-lvalue. --- test/libsolidity/SolidityNameAndTypeResolution.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/libsolidity') diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 4b29243a..de698c77 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -6382,6 +6382,20 @@ BOOST_AUTO_TEST_CASE(using_this_in_constructor) CHECK_WARNING(text, "\"this\" used in constructor"); } +BOOST_AUTO_TEST_CASE(do_not_crash_on_not_lalue) +{ + // This checks for a bug that caused a crash because of continued analysis. + char const* text = R"( + contract C { + mapping (uint => uint) m; + function f() { + m(1) = 2; + } + } + )"; + CHECK_ERROR_ALLOW_MULTI(text, TypeError, "is not callable"); +} + BOOST_AUTO_TEST_SUITE_END() } -- cgit