mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Compiler EVM generation now takes into account for the new function hash
identifier - Changed tests to comply with the new function hash identifier - Changed the function index offset to 4, and made it a constant for easy adjustment in the future
This commit is contained in:
@@ -323,16 +323,13 @@ shared_ptr<FunctionType const> const& ContractType::getConstructorType() const
|
||||
return m_constructorType;
|
||||
}
|
||||
|
||||
unsigned ContractType::getFunctionIndex(string const& _functionName) const
|
||||
u256 ContractType::getFunctionIdentifier(string const& _functionName) const
|
||||
{
|
||||
unsigned index = 0;
|
||||
auto interfaceFunctions = m_contract.getInterfaceFunctions();
|
||||
for (auto it = interfaceFunctions.cbegin(); it != interfaceFunctions.cend(); ++it)
|
||||
{
|
||||
if (it->second->getName() == _functionName)
|
||||
return index;
|
||||
++index;
|
||||
}
|
||||
return FixedHash<4>::Arith(it->first);
|
||||
|
||||
BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Index of non-existing contract function requested."));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user