aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-02-15 18:58:50 +0800
committerchriseth <chris@ethereum.org>2018-02-15 18:58:50 +0800
commite08a20607049175e241654efec90371d2693931c (patch)
tree02f328d8b013970fde8860f68725cc19eb4820e5 /libsolidity/analysis
parent834dac79895811cde1e41d8b4de5d4ef6d758303 (diff)
downloaddexon-solidity-e08a20607049175e241654efec90371d2693931c.tar.gz
dexon-solidity-e08a20607049175e241654efec90371d2693931c.tar.zst
dexon-solidity-e08a20607049175e241654efec90371d2693931c.zip
Disallow uninitialized storage pointers as experimental 0.5.0 feature.
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index d67142e4..f62ddeb9 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -972,7 +972,11 @@ bool TypeChecker::visit(VariableDeclarationStatement const& _statement)
string errorText{"Uninitialized storage pointer."};
if (varDecl.referenceLocation() == VariableDeclaration::Location::Default)
errorText += " Did you mean '<type> memory " + varDecl.name() + "'?";
- m_errorReporter.warning(varDecl.location(), errorText);
+ solAssert(m_scope, "");
+ if (m_scope->sourceUnit().annotation().experimentalFeatures.count(ExperimentalFeature::V050))
+ m_errorReporter.declarationError(varDecl.location(), errorText);
+ else
+ m_errorReporter.warning(varDecl.location(), errorText);
}
}
else if (dynamic_cast<MappingType const*>(type(varDecl).get()))