mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix bug in constant evaluator.
This commit is contained in:
@@ -271,7 +271,8 @@ optional<TypedRational> ConstantEvaluator::evaluate(ASTNode const& _node)
|
||||
if (auto const* varDecl = dynamic_cast<VariableDeclaration const*>(&_node))
|
||||
{
|
||||
solAssert(varDecl->isConstant(), "");
|
||||
if (!varDecl->value())
|
||||
// In some circumstances, we do not yet have a type for the variable.
|
||||
if (!varDecl->value() || !varDecl->type())
|
||||
m_values[&_node] = nullopt;
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user