mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add code access dependency.
This commit is contained in:
parent
e6fee257e6
commit
0bfdaa500a
@ -2100,9 +2100,20 @@ bool TypeChecker::visit(MemberAccess const& _memberAccess)
|
|||||||
{
|
{
|
||||||
if (magicType->kind() == MagicType::Kind::ABI)
|
if (magicType->kind() == MagicType::Kind::ABI)
|
||||||
annotation.isPure = true;
|
annotation.isPure = true;
|
||||||
else if (magicType->kind() == MagicType::Kind::MetaType)
|
else if (magicType->kind() == MagicType::Kind::MetaType && (
|
||||||
if (memberName == "creationCode" || memberName == "runtimeCode")
|
memberName == "creationCode" || memberName == "runtimeCode"
|
||||||
annotation.isPure = true;
|
))
|
||||||
|
{
|
||||||
|
annotation.isPure = true;
|
||||||
|
m_scope->annotation().contractDependencies.insert(
|
||||||
|
&dynamic_cast<ContractType const&>(*magicType->typeArgument()).contractDefinition()
|
||||||
|
);
|
||||||
|
if (contractDependenciesAreCyclic(*m_scope))
|
||||||
|
m_errorReporter.typeError(
|
||||||
|
_memberAccess.location(),
|
||||||
|
"Circular reference for contract code access."
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user