aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLianaHus <liana@ethdev.com>2015-08-25 23:41:23 +0800
committerLianaHus <liana@ethdev.com>2015-09-15 17:37:56 +0800
commit626a57826cd46c25f78cc5cf22e828b3a21b419c (patch)
tree5799cc411fd43c801a2063564cd4ad8efaceb4d5 /test
parent613ba2c3f1b3d26aa4adb5718215e1ececc190d3 (diff)
downloaddexon-solidity-626a57826cd46c25f78cc5cf22e828b3a21b419c.tar
dexon-solidity-626a57826cd46c25f78cc5cf22e828b3a21b419c.tar.gz
dexon-solidity-626a57826cd46c25f78cc5cf22e828b3a21b419c.tar.bz2
dexon-solidity-626a57826cd46c25f78cc5cf22e828b3a21b419c.tar.lz
dexon-solidity-626a57826cd46c25f78cc5cf22e828b3a21b419c.tar.xz
dexon-solidity-626a57826cd46c25f78cc5cf22e828b3a21b419c.tar.zst
dexon-solidity-626a57826cd46c25f78cc5cf22e828b3a21b419c.zip
test
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index c56845aa..43a5043d 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -5262,6 +5262,23 @@ BOOST_AUTO_TEST_CASE(library_stray_values)
BOOST_CHECK(callContractFunction("f(uint256)", u256(33)) == encodeArgs(u256(42)));
}
+BOOST_AUTO_TEST_CASE(array_out_of_bound_access)
+{
+ char const* sourceCode = R"(
+ contract c {
+ uint[4] data;
+ function set(uint index) returns (bool) {
+ data[index] = 2;
+ return true;
+ }
+ }
+ )";
+// compileAndRun(sourceCode, 0, "Test");
+// BOOST_CHECK(callContractFunction("set()", u256(7)) == encodeArgs(false));
+// BOOST_CHECK(callContractFunction("set()", u256(3)) == encodeArgs(true));
+ compileRequireThrow<CompilerError>(sourceCode);
+}
+
BOOST_AUTO_TEST_SUITE_END()
}