diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-07-27 20:59:22 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-27 20:59:22 +0800 |
commit | 53f747b7ded3610802582448257b25e87442bebb (patch) | |
tree | 56584b583f609610a6de1e113c0fdcb9d0bebad0 /test/libsolidity | |
parent | 517a36640469ccf2501f85f763776b04268276c8 (diff) | |
parent | d78f94f0dd82af847dcac40636d1fe83cbff8e4f (diff) | |
download | dexon-solidity-53f747b7ded3610802582448257b25e87442bebb.tar.gz dexon-solidity-53f747b7ded3610802582448257b25e87442bebb.tar.zst dexon-solidity-53f747b7ded3610802582448257b25e87442bebb.zip |
Merge pull request #2635 from ethereum/fixCrashOnAssignmentToNonLValue
Fix crash on assignment to non-LValue
Diffstat (limited to 'test/libsolidity')
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index accf86c6..cd922cc8 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -6437,6 +6437,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() } |