diff options
author | chriseth <c@ethdev.com> | 2015-04-20 20:09:41 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-04-21 19:03:26 +0800 |
commit | e3bd21f4dd5f6f76421ea7a0e8098b2bf97665b6 (patch) | |
tree | f2e4ec4fa7112e7e63d8884d1cc5c0ed243590de /ExpressionCompiler.cpp | |
parent | e4808305a17f43392e03e29546494d464c5f0895 (diff) | |
download | dexon-solidity-e3bd21f4dd5f6f76421ea7a0e8098b2bf97665b6.tar dexon-solidity-e3bd21f4dd5f6f76421ea7a0e8098b2bf97665b6.tar.gz dexon-solidity-e3bd21f4dd5f6f76421ea7a0e8098b2bf97665b6.tar.bz2 dexon-solidity-e3bd21f4dd5f6f76421ea7a0e8098b2bf97665b6.tar.lz dexon-solidity-e3bd21f4dd5f6f76421ea7a0e8098b2bf97665b6.tar.xz dexon-solidity-e3bd21f4dd5f6f76421ea7a0e8098b2bf97665b6.tar.zst dexon-solidity-e3bd21f4dd5f6f76421ea7a0e8098b2bf97665b6.zip |
Fixed byte alignment for return type of ripemd160 built-in contract.
Diffstat (limited to 'ExpressionCompiler.cpp')
-rw-r--r-- | ExpressionCompiler.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ExpressionCompiler.cpp b/ExpressionCompiler.cpp index 7ea71a7a..02f22593 100644 --- a/ExpressionCompiler.cpp +++ b/ExpressionCompiler.cpp @@ -1066,7 +1066,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); } |