mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Extract contractAddressValue into own function
This commit is contained in:
parent
2aba061bde
commit
08781eb8f5
@ -2781,6 +2781,17 @@ MemberAccess const* SMTEncoder::isEmptyPush(Expression const& _expr) const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
smtutil::Expression SMTEncoder::contractAddressValue(FunctionCall const& _f)
|
||||
{
|
||||
FunctionType const& funType = dynamic_cast<FunctionType const&>(*_f.expression().annotation().type);
|
||||
if (funType.kind() == FunctionType::Kind::Internal)
|
||||
return state().thisAddress();
|
||||
auto [funExpr, funOptions] = functionCallExpression(_f);
|
||||
if (MemberAccess const* callBase = dynamic_cast<MemberAccess const*>(funExpr))
|
||||
return expr(callBase->expression());
|
||||
solAssert(false, "Unreachable!");
|
||||
}
|
||||
|
||||
bool SMTEncoder::isPublicGetter(Expression const& _expr) {
|
||||
if (!isTrustedExternalCall(&_expr))
|
||||
return false;
|
||||
|
||||
@ -229,6 +229,8 @@ protected:
|
||||
|
||||
bool isPublicGetter(Expression const& _expr);
|
||||
|
||||
smtutil::Expression contractAddressValue(FunctionCall const& _f);
|
||||
|
||||
/// Encodes a modifier or function body according to the modifier
|
||||
/// visit depth.
|
||||
void visitFunctionOrModifier();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user