diff options
author | chriseth <c@ethdev.com> | 2016-07-28 23:19:17 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-07-28 23:24:18 +0800 |
commit | 58cc6cbb379015d57b8f6dec3b4a5c207ccb6b0b (patch) | |
tree | 5f838b1813be0088e459c205af14cd04392a138b /test/libsolidity/SolidityEndToEndTest.cpp | |
parent | ea4fd3c6e25517180a773a6e4b51de0505e781ec (diff) | |
download | dexon-solidity-58cc6cbb379015d57b8f6dec3b4a5c207ccb6b0b.tar.gz dexon-solidity-58cc6cbb379015d57b8f6dec3b4a5c207ccb6b0b.tar.zst dexon-solidity-58cc6cbb379015d57b8f6dec3b4a5c207ccb6b0b.zip |
Bugfix: Allocate empty array.
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r-- | test/libsolidity/SolidityEndToEndTest.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index 8dcc878e..4b634649 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -6837,6 +6837,20 @@ BOOST_AUTO_TEST_CASE(skip_dynamic_types_for_structs) BOOST_CHECK(callContractFunction("g()") == encodeArgs(u256(2), u256(6))); } +BOOST_AUTO_TEST_CASE(create_dynamic_array_with_zero_length) +{ + char const* sourceCode = R"( + contract C { + function f() returns (uint) { + var a = new uint[][](0); + return 7; + } + } + )"; + compileAndRun(sourceCode, 0, "C"); + BOOST_CHECK(callContractFunction("f()") == encodeArgs(u256(7))); +} + BOOST_AUTO_TEST_SUITE_END() } |