aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-07-04 17:23:51 +0800
committerchriseth <chris@ethereum.org>2018-07-05 20:18:14 +0800
commitc8ac8618324d8d167c79a926880b2b5ab853f7f3 (patch)
tree9aeba99e7ee74e34c91aae2792a8b2a291745e4e /test
parentb1ab81ef22030ee16c6d216bfe6a4dc74b726985 (diff)
downloaddexon-solidity-c8ac8618324d8d167c79a926880b2b5ab853f7f3.tar
dexon-solidity-c8ac8618324d8d167c79a926880b2b5ab853f7f3.tar.gz
dexon-solidity-c8ac8618324d8d167c79a926880b2b5ab853f7f3.tar.bz2
dexon-solidity-c8ac8618324d8d167c79a926880b2b5ab853f7f3.tar.lz
dexon-solidity-c8ac8618324d8d167c79a926880b2b5ab853f7f3.tar.xz
dexon-solidity-c8ac8618324d8d167c79a926880b2b5ab853f7f3.tar.zst
dexon-solidity-c8ac8618324d8d167c79a926880b2b5ab853f7f3.zip
Fix allocation of byte arrays.
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index 4b1cb99b..bc613868 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -8060,7 +8060,7 @@ BOOST_AUTO_TEST_CASE(create_memory_array_allocation_size)
// multiple of 32
char const* sourceCode = R"(
contract C {
- function f() public pure returns (uint d1, uint d2, uint d3) {
+ function f() public pure returns (uint d1, uint d2, uint d3, uint memsize) {
bytes memory b1 = new bytes(31);
bytes memory b2 = new bytes(32);
bytes memory b3 = new bytes(256);
@@ -8069,12 +8069,13 @@ BOOST_AUTO_TEST_CASE(create_memory_array_allocation_size)
d1 := sub(b2, b1)
d2 := sub(b3, b2)
d3 := sub(b4, b3)
+ memsize := msize()
}
}
}
)";
compileAndRun(sourceCode);
- ABI_CHECK(callContractFunction("f()"), encodeArgs(0x40, 0x40, 0x20 + 256));
+ ABI_CHECK(callContractFunction("f()"), encodeArgs(0x40, 0x40, 0x20 + 256, 0x260));
}
BOOST_AUTO_TEST_CASE(memory_arrays_of_various_sizes)