Merge pull request #8856 from ethereum/implicitConstructorCallvalueCheck

Implicit constructor callvalue check
This commit is contained in:
Daniel Kirchner
2020-05-11 18:50:36 +02:00
committed by GitHub
8 changed files with 169 additions and 4 deletions
+5 -2
View File
@@ -157,10 +157,13 @@ void ContractCompiler::appendInitAndConstructorCode(ContractDefinition const& _c
if (FunctionDefinition const* constructor = _contract.constructor())
appendConstructor(*constructor);
else if (auto c = _contract.nextConstructor(m_context.mostDerivedContract()))
appendBaseConstructor(*c);
else
{
// Implicit constructors are always non-payable.
appendCallValueCheck();
if (auto c = _contract.nextConstructor(m_context.mostDerivedContract()))
appendBaseConstructor(*c);
}
}
size_t ContractCompiler::packIntoContractCreator(ContractDefinition const& _contract)