diff options
author | chriseth <chris@ethereum.org> | 2018-09-04 22:24:21 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-09-05 00:19:00 +0800 |
commit | 624dbbe142fb04fdcdd83d843a00138eed296763 (patch) | |
tree | cae35a87edd37136bee36c234cea50895eea9c81 /libsolidity/codegen | |
parent | 9daac90cf7d0a28f5d631b9f5234e4268b5b61b7 (diff) | |
download | dexon-solidity-624dbbe142fb04fdcdd83d843a00138eed296763.tar dexon-solidity-624dbbe142fb04fdcdd83d843a00138eed296763.tar.gz dexon-solidity-624dbbe142fb04fdcdd83d843a00138eed296763.tar.bz2 dexon-solidity-624dbbe142fb04fdcdd83d843a00138eed296763.tar.lz dexon-solidity-624dbbe142fb04fdcdd83d843a00138eed296763.tar.xz dexon-solidity-624dbbe142fb04fdcdd83d843a00138eed296763.tar.zst dexon-solidity-624dbbe142fb04fdcdd83d843a00138eed296763.zip |
Fix abi.decode returning single value.
Diffstat (limited to 'libsolidity/codegen')
-rw-r--r-- | libsolidity/codegen/ExpressionCompiler.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp index 3e8b7337..aa9e438f 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) |