mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[SMTChecker] Do not create targets for contracts that cannot be deployed
This commit is contained in:
@@ -841,7 +841,7 @@ void BMC::addVerificationTarget(
|
||||
Expression const* _expression
|
||||
)
|
||||
{
|
||||
if (!m_settings.targets.has(_type))
|
||||
if (!m_settings.targets.has(_type) || (m_currentContract && !m_currentContract->canBeDeployed()))
|
||||
return;
|
||||
|
||||
BMCVerificationTarget target{
|
||||
|
||||
@@ -197,13 +197,17 @@ void CHC::endVisit(ContractDefinition const& _contract)
|
||||
connectBlocks(m_currentBlock, summary(_contract));
|
||||
|
||||
setCurrentBlock(*m_constructorSummaries.at(&_contract));
|
||||
auto constructor = _contract.constructor();
|
||||
auto txConstraints = state().txTypeConstraints();
|
||||
if (!constructor || !constructor->isPayable())
|
||||
txConstraints = txConstraints && state().txNonPayableConstraint();
|
||||
m_queryPlaceholders[&_contract].push_back({txConstraints, errorFlag().currentValue(), m_currentBlock});
|
||||
connectBlocks(m_currentBlock, interface(), txConstraints && errorFlag().currentValue() == 0);
|
||||
|
||||
solAssert(&_contract == m_currentContract, "");
|
||||
if (_contract.canBeDeployed())
|
||||
{
|
||||
auto constructor = _contract.constructor();
|
||||
auto txConstraints = state().txTypeConstraints();
|
||||
if (!constructor || !constructor->isPayable())
|
||||
txConstraints = txConstraints && state().txNonPayableConstraint();
|
||||
m_queryPlaceholders[&_contract].push_back({txConstraints, errorFlag().currentValue(), m_currentBlock});
|
||||
connectBlocks(m_currentBlock, interface(), txConstraints && errorFlag().currentValue() == 0);
|
||||
}
|
||||
SMTEncoder::endVisit(_contract);
|
||||
}
|
||||
|
||||
@@ -262,7 +266,8 @@ void CHC::endVisit(FunctionDefinition const& _function)
|
||||
if (
|
||||
!_function.isConstructor() &&
|
||||
_function.isPublic() &&
|
||||
contractFunctions(*m_currentContract).count(&_function)
|
||||
contractFunctions(*m_currentContract).count(&_function) &&
|
||||
m_currentContract->canBeDeployed()
|
||||
)
|
||||
{
|
||||
auto sum = summary(_function);
|
||||
|
||||
Reference in New Issue
Block a user