diff options
author | Christian Parpart <christian@parpart.family> | 2018-10-05 21:38:14 +0800 |
---|---|---|
committer | Christian Parpart <christian@ethereum.org> | 2018-10-15 16:35:11 +0800 |
commit | 6d815a142fbf85e19ab4f061c6e4275a26ff2e5f (patch) | |
tree | e8ccd335af9f64d139304d23bb3dc8df50577cfa /libsolidity | |
parent | 26dc876c28718613ad64961e65374ace1139010b (diff) | |
download | dexon-solidity-6d815a142fbf85e19ab4f061c6e4275a26ff2e5f.tar.gz dexon-solidity-6d815a142fbf85e19ab4f061c6e4275a26ff2e5f.tar.zst dexon-solidity-6d815a142fbf85e19ab4f061c6e4275a26ff2e5f.zip |
Fixes invalid function calls to literals inside tuple assignment's LHS.
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 069be156..164b0b02 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -1444,8 +1444,12 @@ void TypeChecker::checkExpressionAssignment(Type const& _type, Expression const& auto const* tupleType = dynamic_cast<TupleType const*>(&_type); auto const& types = tupleType ? tupleType->components() : vector<TypePointer> { _type.shared_from_this() }; - solAssert(tupleExpression->components().size() == types.size(), ""); - for (size_t i = 0; i < types.size(); i++) + solAssert( + tupleExpression->components().size() == types.size() || m_errorReporter.hasErrors(), + "Array sizes don't match or no errors generated." + ); + + for (size_t i = 0; i < min(tupleExpression->components().size(), types.size()); i++) if (types[i]) { solAssert(!!tupleExpression->components()[i], ""); |