diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-08-08 03:43:20 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2018-08-08 03:43:20 +0800 |
commit | f024efb7abca7cea11735ab1e8afad90eb35284d (patch) | |
tree | 78c31917ef2f821f414ed957e34dd63136b91468 /libsolidity/formal | |
parent | 9d3827266cc734ac91368acff010e094f100f850 (diff) | |
download | dexon-solidity-f024efb7abca7cea11735ab1e8afad90eb35284d.tar.gz dexon-solidity-f024efb7abca7cea11735ab1e8afad90eb35284d.tar.zst dexon-solidity-f024efb7abca7cea11735ab1e8afad90eb35284d.zip |
SMT: do not crash on referencing MagicVariableDeclaration
Diffstat (limited to 'libsolidity/formal')
-rw-r--r-- | libsolidity/formal/SMTChecker.cpp | 10 |
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())) { |