diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-07-27 20:59:22 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-27 20:59:22 +0800 |
commit | 53f747b7ded3610802582448257b25e87442bebb (patch) | |
tree | 56584b583f609610a6de1e113c0fdcb9d0bebad0 /libsolidity | |
parent | 517a36640469ccf2501f85f763776b04268276c8 (diff) | |
parent | d78f94f0dd82af847dcac40636d1fe83cbff8e4f (diff) | |
download | dexon-solidity-53f747b7ded3610802582448257b25e87442bebb.tar.gz dexon-solidity-53f747b7ded3610802582448257b25e87442bebb.tar.zst dexon-solidity-53f747b7ded3610802582448257b25e87442bebb.zip |
Merge pull request #2635 from ethereum/fixCrashOnAssignmentToNonLValue
Fix crash on assignment to non-LValue
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 0d04c26d..1ee827d4 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -1122,7 +1122,9 @@ bool TypeChecker::visit(Assignment const& _assignment) _assignment.annotation().type = make_shared<TupleType>(); expectType(_assignment.rightHandSide(), *tupleType); - checkDoubleStorageAssignment(_assignment); + // expectType does not cause fatal errors, so we have to check again here. + if (dynamic_cast<TupleType const*>(type(_assignment.rightHandSide()).get())) + checkDoubleStorageAssignment(_assignment); } else if (t->category() == Type::Category::Mapping) { |