aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-07-26 20:19:46 +0800
committerchriseth <chris@ethereum.org>2017-07-26 20:32:25 +0800
commitcb75e6218b4e02cb7c7a592598211503d44abc12 (patch)
treed100e32caa7f201dc6d0e05b9e6b5bef6d6bf6ca
parentb8fc58850d9f37c22dedca3ed189f2fdd5458236 (diff)
downloaddexon-solidity-cb75e6218b4e02cb7c7a592598211503d44abc12.tar.gz
dexon-solidity-cb75e6218b4e02cb7c7a592598211503d44abc12.tar.zst
dexon-solidity-cb75e6218b4e02cb7c7a592598211503d44abc12.zip
Fix crash on assignment to non-lvalue.
-rw-r--r--libsolidity/analysis/TypeChecker.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index 23f01752..7a766489 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -1124,7 +1124,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)
{