diff options
author | chriseth <chris@ethereum.org> | 2017-07-06 18:45:11 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-06 18:45:11 +0800 |
commit | 0fb4cb1ab9bb4b6cc72e28cc5a1753ad14781f14 (patch) | |
tree | 1031e61422e41884ecd548953f83ef4df9441f61 /test/libsolidity/SolidityEndToEndTest.cpp | |
parent | 194ff033ae44944ac59aa7bd3da89ba94ec5893c (diff) | |
parent | 40d4ee49528affa1e88031920a9be57375ad5788 (diff) | |
download | dexon-solidity-0fb4cb1ab9bb4b6cc72e28cc5a1753ad14781f14.tar dexon-solidity-0fb4cb1ab9bb4b6cc72e28cc5a1753ad14781f14.tar.gz dexon-solidity-0fb4cb1ab9bb4b6cc72e28cc5a1753ad14781f14.tar.bz2 dexon-solidity-0fb4cb1ab9bb4b6cc72e28cc5a1753ad14781f14.tar.lz dexon-solidity-0fb4cb1ab9bb4b6cc72e28cc5a1753ad14781f14.tar.xz dexon-solidity-0fb4cb1ab9bb4b6cc72e28cc5a1753ad14781f14.tar.zst dexon-solidity-0fb4cb1ab9bb4b6cc72e28cc5a1753ad14781f14.zip |
Merge pull request #2532 from ethereum/develop
Merge develop to release for 0.4.13.
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r-- | test/libsolidity/SolidityEndToEndTest.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index a6c01283..c9771fbd 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -9696,6 +9696,33 @@ BOOST_AUTO_TEST_CASE(keccak256_assembly) BOOST_CHECK(callContractFunction("i()") == fromHex("0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470")); } +BOOST_AUTO_TEST_CASE(multi_modifiers) +{ + // This triggered a bug in some version because the variable in the modifier was not + // unregistered correctly. + char const* sourceCode = R"( + contract C { + uint public x; + modifier m1 { + address a1 = msg.sender; + x++; + _; + } + function f1() m1() { + x += 7; + } + function f2() m1() { + x += 3; + } + } + )"; + compileAndRun(sourceCode, 0, "C"); + BOOST_CHECK(callContractFunction("f1()") == bytes()); + BOOST_CHECK(callContractFunction("x()") == encodeArgs(u256(8))); + BOOST_CHECK(callContractFunction("f2()") == bytes()); + BOOST_CHECK(callContractFunction("x()") == encodeArgs(u256(12))); +} + BOOST_AUTO_TEST_SUITE_END() } |