diff options
author | Daniel Kirchner <daniel@ekpyron.org> | 2018-08-08 00:44:51 +0800 |
---|---|---|
committer | Daniel Kirchner <daniel@ekpyron.org> | 2018-08-08 00:51:53 +0800 |
commit | b11e39e25ee14b2d56db86ea48e3229a7a6cad52 (patch) | |
tree | f818c974e2cfaf35a1667573837e50bd6f312022 /libsolidity/analysis | |
parent | d7756322c07634fa2ca0649a33585fc167079786 (diff) | |
download | dexon-solidity-b11e39e25ee14b2d56db86ea48e3229a7a6cad52.tar dexon-solidity-b11e39e25ee14b2d56db86ea48e3229a7a6cad52.tar.gz dexon-solidity-b11e39e25ee14b2d56db86ea48e3229a7a6cad52.tar.bz2 dexon-solidity-b11e39e25ee14b2d56db86ea48e3229a7a6cad52.tar.lz dexon-solidity-b11e39e25ee14b2d56db86ea48e3229a7a6cad52.tar.xz dexon-solidity-b11e39e25ee14b2d56db86ea48e3229a7a6cad52.tar.zst dexon-solidity-b11e39e25ee14b2d56db86ea48e3229a7a6cad52.zip |
Remove remaining instances of ``fillRight`` left over from tuple wildcards assignments.
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 38331a43..bd3187ae 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -498,7 +498,12 @@ void TypeChecker::checkDoubleStorageAssignment(Assignment const& _assignment) TupleType const& lhs = dynamic_cast<TupleType const&>(*type(_assignment.leftHandSide())); TupleType const& rhs = dynamic_cast<TupleType const&>(*type(_assignment.rightHandSide())); - bool fillRight = !lhs.components().empty() && (!lhs.components().back() || lhs.components().front()); + if (lhs.components().size() != rhs.components().size()) + { + solAssert(m_errorReporter.hasErrors(), ""); + return; + } + size_t storageToStorageCopies = 0; size_t toStorageCopies = 0; for (size_t i = 0; i < lhs.components().size(); ++i) @@ -506,10 +511,8 @@ void TypeChecker::checkDoubleStorageAssignment(Assignment const& _assignment) ReferenceType const* ref = dynamic_cast<ReferenceType const*>(lhs.components()[i].get()); if (!ref || !ref->dataStoredIn(DataLocation::Storage) || ref->isPointer()) continue; - size_t rhsPos = fillRight ? i : rhs.components().size() - (lhs.components().size() - i); - solAssert(rhsPos < rhs.components().size(), ""); toStorageCopies++; - if (rhs.components()[rhsPos]->dataStoredIn(DataLocation::Storage)) + if (rhs.components()[i]->dataStoredIn(DataLocation::Storage)) storageToStorageCopies++; } if (storageToStorageCopies >= 1 && toStorageCopies >= 2) |