Replace casting of external functions to address by a member named "address".

This commit is contained in:
Daniel Kirchner
2019-08-19 14:56:04 +02:00
committed by chriseth
parent d3ea86b052
commit 9f6fff2120
12 changed files with 72 additions and 51 deletions
@@ -1338,6 +1338,13 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
/// need to store it as bytes4
utils().leftShiftNumberOnStack(224);
}
else if (member == "address")
{
auto const& functionType = dynamic_cast<FunctionType const&>(*_memberAccess.expression().annotation().type);
solAssert(functionType.kind() == FunctionType::Kind::External, "");
// stack: <address> <function_id>
m_context << Instruction::POP;
}
else
solAssert(
!!_memberAccess.expression().annotation().type->memberType(member),