[SMTChecker] Fix bad cast in base constructor modifier.

This commit is contained in:
Leonardo Alt 2019-04-30 18:22:54 +02:00
parent b6bcd8a153
commit a6db37ac9c
4 changed files with 24 additions and 2 deletions

View File

@ -7,6 +7,7 @@ Compiler Features:
Bugfixes:
* SMTChecker: Fix bad cast in base constructor modifier.

View File

@ -101,13 +101,18 @@ bool SMTChecker::visit(ModifierDefinition const&)
bool SMTChecker::visit(FunctionDefinition const& _function)
{
m_functionPath.push_back(&_function);
m_modifierDepthStack.push_back(-1);
if (_function.isConstructor())
{
m_errorReporter.warning(
_function.location(),
"Assertion checker does not yet support constructors."
);
m_functionPath.push_back(&_function);
m_modifierDepthStack.push_back(-1);
return false;
}
// Not visited by a function call
if (isRootFunction())
{

View File

@ -0,0 +1,6 @@
pragma experimental SMTChecker;
contract C { constructor(uint) public {} }
contract A is C { constructor() C(2) public {} }
// ----
// Warning: (45-72): Assertion checker does not yet support constructors.
// Warning: (93-121): Assertion checker does not yet support constructors.

View File

@ -0,0 +1,10 @@
pragma experimental SMTChecker;
contract C { constructor(uint) public {} }
contract A is C { constructor() C(2) public {} }
contract B is C { constructor() C(3) public {} }
contract J is C { constructor() C(3) public {} }
// ----
// Warning: (45-72): Assertion checker does not yet support constructors.
// Warning: (93-121): Assertion checker does not yet support constructors.
// Warning: (142-170): Assertion checker does not yet support constructors.
// Warning: (191-219): Assertion checker does not yet support constructors.