mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #1685 from chriseth/sol_fix_ripemd_alignment
Fixed byte alignment for return type of ripemd160 built-in contract.
This commit is contained in:
commit
1f44d93e05
@ -1075,7 +1075,13 @@ void ExpressionCompiler::appendExternalFunctionCall(FunctionType const& _functio
|
|||||||
m_context << eth::Instruction::POP;
|
m_context << eth::Instruction::POP;
|
||||||
m_context << eth::Instruction::POP; // pop contract address
|
m_context << eth::Instruction::POP; // pop contract address
|
||||||
|
|
||||||
if (firstType)
|
if (_functionType.getLocation() == FunctionType::Location::RIPEMD160)
|
||||||
|
{
|
||||||
|
// fix: built-in contract returns right-aligned data
|
||||||
|
CompilerUtils(m_context).loadFromMemory(0, IntegerType(160), false, true);
|
||||||
|
appendTypeConversion(IntegerType(160), FixedBytesType(20));
|
||||||
|
}
|
||||||
|
else if (firstType)
|
||||||
CompilerUtils(m_context).loadFromMemory(0, *firstType, false, true);
|
CompilerUtils(m_context).loadFromMemory(0, *firstType, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user