aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/ExpressionCompiler.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-09-05 05:47:56 +0800
committerGitHub <noreply@github.com>2018-09-05 05:47:56 +0800
commite6aa15bae1839ce6761c75521e0166c06469dc2e (patch)
tree76969e415aa662d6d885bf41b6f938a04a986add /libsolidity/codegen/ExpressionCompiler.cpp
parent85debe77d9b616a37ecf0ed080045b3747b3aa7d (diff)
parent624dbbe142fb04fdcdd83d843a00138eed296763 (diff)
downloaddexon-solidity-e6aa15bae1839ce6761c75521e0166c06469dc2e.tar
dexon-solidity-e6aa15bae1839ce6761c75521e0166c06469dc2e.tar.gz
dexon-solidity-e6aa15bae1839ce6761c75521e0166c06469dc2e.tar.bz2
dexon-solidity-e6aa15bae1839ce6761c75521e0166c06469dc2e.tar.lz
dexon-solidity-e6aa15bae1839ce6761c75521e0166c06469dc2e.tar.xz
dexon-solidity-e6aa15bae1839ce6761c75521e0166c06469dc2e.tar.zst
dexon-solidity-e6aa15bae1839ce6761c75521e0166c06469dc2e.zip
Merge pull request #4895 from ethereum/abidecodesingle
Fix abi.decode returning single value.
Diffstat (limited to 'libsolidity/codegen/ExpressionCompiler.cpp')
-rw-r--r--libsolidity/codegen/ExpressionCompiler.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp
index a13b3e6c..4cc4ba53 100644
--- a/libsolidity/codegen/ExpressionCompiler.cpp
+++ b/libsolidity/codegen/ExpressionCompiler.cpp
@@ -1074,7 +1074,11 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
{
arguments.front()->accept(*this);
TypePointer firstArgType = arguments.front()->annotation().type;
- TypePointers const& targetTypes = dynamic_cast<TupleType const&>(*_functionCall.annotation().type).components();
+ TypePointers targetTypes;
+ if (TupleType const* targetTupleType = dynamic_cast<TupleType const*>(_functionCall.annotation().type.get()))
+ targetTypes = targetTupleType->components();
+ else
+ targetTypes = TypePointers{_functionCall.annotation().type};
if (
*firstArgType == ArrayType(DataLocation::CallData) ||
*firstArgType == ArrayType(DataLocation::CallData, true)