aboutsummaryrefslogtreecommitdiffstats
path: root/test/liblll
diff options
context:
space:
mode:
authorbenjaminion <ben@edginet.org>2017-06-22 20:18:54 +0800
committerbenjaminion <ben@edginet.org>2017-06-22 20:46:52 +0800
commit0175008ffaaeecf1d110ef55f736f8ce45ffe90f (patch)
treee0f9959974eef531fcbf70c3fac8bc6a35c57999 /test/liblll
parentf823952d9f0cc1e37dec465111db976c7a1830b2 (diff)
downloaddexon-solidity-0175008ffaaeecf1d110ef55f736f8ce45ffe90f.tar.gz
dexon-solidity-0175008ffaaeecf1d110ef55f736f8ce45ffe90f.tar.zst
dexon-solidity-0175008ffaaeecf1d110ef55f736f8ce45ffe90f.zip
LLL: Fix msg macro with six arguments.
The previous macro used the set built-in in a way incompatible with the current implementation of set. This commit updates the macro to be more transparent in how it's working and avoids the use of the set and alloc built-ins.
Diffstat (limited to 'test/liblll')
-rw-r--r--test/liblll/EndToEndTest.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/liblll/EndToEndTest.cpp b/test/liblll/EndToEndTest.cpp
index 50949e98..02d024a4 100644
--- a/test/liblll/EndToEndTest.cpp
+++ b/test/liblll/EndToEndTest.cpp
@@ -366,6 +366,23 @@ BOOST_AUTO_TEST_CASE(keccak256_32bytes)
fromHex("b10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6")));
}
+BOOST_AUTO_TEST_CASE(msg_six_args)
+{
+ char const* sourceCode = R"(
+ (returnlll
+ (seq
+ (when (= 0 (calldatasize))
+ (seq
+ (mstore 0x40 1)
+ (def 'outsize 0x20)
+ (return (msg 1000 (address) 42 0x40 0x20 outsize) outsize)))
+ (when (= 1 (calldataload 0x00))
+ (return (callvalue)))))
+ )";
+ compileAndRun(sourceCode);
+ BOOST_CHECK(callFallbackWithValue(42) == encodeArgs(u256(42)));
+}
+
BOOST_AUTO_TEST_CASE(create_1_arg)
{
char const* sourceCode = R"(