mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix SMT Checker crash due to missing type information
This commit is contained in:
parent
f9d1c283b7
commit
f782125463
@ -448,6 +448,9 @@ bool TypeChecker::visit(VariableDeclaration const& _variable)
|
|||||||
)
|
)
|
||||||
m_errorReporter.typeError(_variable.location(), "Variables cannot be declared in interfaces.");
|
m_errorReporter.typeError(_variable.location(), "Variables cannot be declared in interfaces.");
|
||||||
|
|
||||||
|
if (_variable.typeName())
|
||||||
|
_variable.typeName()->accept(*this);
|
||||||
|
|
||||||
// type is filled either by ReferencesResolver directly from the type name or by
|
// type is filled either by ReferencesResolver directly from the type name or by
|
||||||
// TypeChecker at the VariableDeclarationStatement level.
|
// TypeChecker at the VariableDeclarationStatement level.
|
||||||
TypePointer varType = _variable.annotation().type;
|
TypePointer varType = _variable.annotation().type;
|
||||||
|
@ -695,6 +695,7 @@ void SMTChecker::visitFunctionIdentifier(Identifier const& _identifier)
|
|||||||
|
|
||||||
void SMTChecker::endVisit(Literal const& _literal)
|
void SMTChecker::endVisit(Literal const& _literal)
|
||||||
{
|
{
|
||||||
|
solAssert(_literal.annotation().type, "Expected type for AST node");
|
||||||
Type const& type = *_literal.annotation().type;
|
Type const& type = *_literal.annotation().type;
|
||||||
if (isNumber(type.category()))
|
if (isNumber(type.category()))
|
||||||
|
|
||||||
|
@ -3,6 +3,10 @@ contract C
|
|||||||
{
|
{
|
||||||
// Used to crash because Literal had no type
|
// Used to crash because Literal had no type
|
||||||
int[3] d;
|
int[3] d;
|
||||||
|
// Used to crash because Literal had no type
|
||||||
|
int[3*1] x;
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// Warning: (92-100): Assertion checker does not yet support the type of this variable.
|
// Warning: (92-100): Assertion checker does not yet support the type of this variable.
|
||||||
|
// Warning: (149-159): Assertion checker does not yet support the type of this variable.
|
||||||
|
// Warning: (153-156): Assertion checker does not yet implement this operator on non-integer types.
|
||||||
|
Loading…
Reference in New Issue
Block a user