Merge pull request #6636 from ethereum/smt_fix_constructor

[SMTChecker] Fix bad cast in base constructor modifier.
This commit is contained in:
chriseth 2019-05-02 09:50:24 +02:00 committed by GitHub
commit 90f2fe6fd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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.