aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-02-15 20:05:21 +0800
committerGitHub <noreply@github.com>2018-02-15 20:05:21 +0800
commit5746e2d7d867440780ced524dd7e7c29149cf3e2 (patch)
tree02f328d8b013970fde8860f68725cc19eb4820e5 /test
parent834dac79895811cde1e41d8b4de5d4ef6d758303 (diff)
parente08a20607049175e241654efec90371d2693931c (diff)
downloaddexon-solidity-5746e2d7d867440780ced524dd7e7c29149cf3e2.tar
dexon-solidity-5746e2d7d867440780ced524dd7e7c29149cf3e2.tar.gz
dexon-solidity-5746e2d7d867440780ced524dd7e7c29149cf3e2.tar.bz2
dexon-solidity-5746e2d7d867440780ced524dd7e7c29149cf3e2.tar.lz
dexon-solidity-5746e2d7d867440780ced524dd7e7c29149cf3e2.tar.xz
dexon-solidity-5746e2d7d867440780ced524dd7e7c29149cf3e2.tar.zst
dexon-solidity-5746e2d7d867440780ced524dd7e7c29149cf3e2.zip
Merge pull request #3521 from ethereum/uninitializedStoragePointers
Disallow uninitialized storage pointers as experimental 0.5.0 feature.
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 315c7c5f..2b102312 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -3021,6 +3021,20 @@ BOOST_AUTO_TEST_CASE(uninitialized_mapping_array_variable)
CHECK_WARNING(sourceCode, "Uninitialized storage pointer");
}
+BOOST_AUTO_TEST_CASE(uninitialized_mapping_array_variable_050)
+{
+ char const* sourceCode = R"(
+ pragma experimental "v0.5.0";
+ contract C {
+ function f() pure public {
+ mapping(uint => uint)[] storage x;
+ x;
+ }
+ }
+ )";
+ CHECK_ERROR(sourceCode, DeclarationError, "Uninitialized storage pointer");
+}
+
BOOST_AUTO_TEST_CASE(no_delete_on_storage_pointers)
{
char const* sourceCode = R"(
@@ -3320,6 +3334,24 @@ BOOST_AUTO_TEST_CASE(non_initialized_references)
CHECK_WARNING(text, "Uninitialized storage pointer");
}
+BOOST_AUTO_TEST_CASE(non_initialized_references_050)
+{
+ char const* text = R"(
+ pragma experimental "v0.5.0";
+ contract c
+ {
+ struct s {
+ uint a;
+ }
+ function f() public {
+ s storage x;
+ }
+ }
+ )";
+
+ CHECK_ERROR(text, DeclarationError, "Uninitialized storage pointer");
+}
+
BOOST_AUTO_TEST_CASE(keccak256_with_large_integer_constant)
{
char const* text = R"(