aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-08-08 04:30:14 +0800
committerGitHub <noreply@github.com>2018-08-08 04:30:14 +0800
commit4dc3335cda18bae7c683227a9795a7cc1de95fd2 (patch)
treec4b20da6a5867d0c0cca4ed0288752ca98c6bf6b
parent8e93b729a4fb50d1d0f21b86a7434ed91ae8826a (diff)
parentf024efb7abca7cea11735ab1e8afad90eb35284d (diff)
downloaddexon-solidity-4dc3335cda18bae7c683227a9795a7cc1de95fd2.tar
dexon-solidity-4dc3335cda18bae7c683227a9795a7cc1de95fd2.tar.gz
dexon-solidity-4dc3335cda18bae7c683227a9795a7cc1de95fd2.tar.bz2
dexon-solidity-4dc3335cda18bae7c683227a9795a7cc1de95fd2.tar.lz
dexon-solidity-4dc3335cda18bae7c683227a9795a7cc1de95fd2.tar.xz
dexon-solidity-4dc3335cda18bae7c683227a9795a7cc1de95fd2.tar.zst
dexon-solidity-4dc3335cda18bae7c683227a9795a7cc1de95fd2.zip
Merge pull request #4744 from ethereum/smt-magic-variable
SMT: do not crash on referencing MagicVariableDeclaration
-rw-r--r--libsolidity/formal/SMTChecker.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/libsolidity/formal/SMTChecker.cpp b/libsolidity/formal/SMTChecker.cpp
index 17b50a38..88c1e56a 100644
--- a/libsolidity/formal/SMTChecker.cpp
+++ b/libsolidity/formal/SMTChecker.cpp
@@ -375,8 +375,14 @@ void SMTChecker::endVisit(Identifier const& _identifier)
}
else if (SSAVariable::isSupportedType(_identifier.annotation().type->category()))
{
- VariableDeclaration const& decl = dynamic_cast<VariableDeclaration const&>(*(_identifier.annotation().referencedDeclaration));
- defineExpr(_identifier, currentValue(decl));
+ if (VariableDeclaration const* decl = dynamic_cast<VariableDeclaration const*>(_identifier.annotation().referencedDeclaration))
+ defineExpr(_identifier, currentValue(*decl));
+ else
+ // TODO: handle MagicVariableDeclaration here
+ m_errorReporter.warning(
+ _identifier.location(),
+ "Assertion checker does not yet support the type of this variable."
+ );
}
else if (FunctionType const* fun = dynamic_cast<FunctionType const*>(_identifier.annotation().type.get()))
{