aboutsummaryrefslogtreecommitdiffstats
path: root/ExpressionCompiler.cpp
diff options
context:
space:
mode:
authorGav Wood <g@ethdev.com>2015-04-21 23:33:02 +0800
committerGav Wood <g@ethdev.com>2015-04-21 23:33:02 +0800
commit1f44d93e052d9a8b22d362fba2493f5c7dfa38d2 (patch)
tree5aa82bcbd81c39a27e080d924b4c291515ed4c76 /ExpressionCompiler.cpp
parent5f6a396765c722eca567cee930bc7621a6a20807 (diff)
parente3bd21f4dd5f6f76421ea7a0e8098b2bf97665b6 (diff)
downloaddexon-solidity-1f44d93e052d9a8b22d362fba2493f5c7dfa38d2.tar.gz
dexon-solidity-1f44d93e052d9a8b22d362fba2493f5c7dfa38d2.tar.zst
dexon-solidity-1f44d93e052d9a8b22d362fba2493f5c7dfa38d2.zip
Merge pull request #1685 from chriseth/sol_fix_ripemd_alignment
Fixed byte alignment for return type of ripemd160 built-in contract.
Diffstat (limited to 'ExpressionCompiler.cpp')
-rw-r--r--ExpressionCompiler.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/ExpressionCompiler.cpp b/ExpressionCompiler.cpp
index 8877d9c0..cf6a01ec 100644
--- a/ExpressionCompiler.cpp
+++ b/ExpressionCompiler.cpp
@@ -1075,7 +1075,13 @@ void ExpressionCompiler::appendExternalFunctionCall(FunctionType const& _functio
m_context << eth::Instruction::POP;
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);
}