[SMTChecker] Fix ICE when tuples have extra effectless parens

This commit is contained in:
Leonardo Alt
2020-07-27 13:03:27 +02:00
parent 5812cd8213
commit de4ae301c4
8 changed files with 43 additions and 1 deletions
+1
View File
@@ -35,6 +35,7 @@ Bugfixes:
* Inheritance: Disallow public state variables overwriting ``pure`` functions.
* NatSpec: Constructors and functions have consistent userdoc output.
* SMTChecker: Fix internal error when assigning to a 1-tuple.
* SMTChecker: Fix internal error when tuples have extra effectless parenthesis.
* State Mutability: Constant public state variables are considered ``pure`` functions.
* Type Checker: Fixing deduction issues on function types when function call has named arguments.
* Immutables: Fix internal compiler error when immutables are not assigned.
+1 -1
View File
@@ -1470,7 +1470,7 @@ void SMTEncoder::assignment(
void SMTEncoder::tupleAssignment(Expression const& _left, Expression const& _right)
{
auto lTuple = dynamic_cast<TupleExpression const*>(&_left);
auto lTuple = dynamic_cast<TupleExpression const*>(innermostTuple(dynamic_cast<TupleExpression const&>(_left)));
solAssert(lTuple, "");
auto const& lComponents = lTuple->components();
@@ -0,0 +1,7 @@
pragma experimental SMTChecker;
contract C {
function f2() public pure returns(int) {
int a;
((, a)) = (1, 2);
}
}
@@ -0,0 +1,7 @@
pragma experimental SMTChecker;
contract C {
function f2() public pure returns(int) {
int a;
(((, a),)) = ((1, 2), 3);
}
}
@@ -0,0 +1,7 @@
pragma experimental SMTChecker;
contract C {
function f2() public pure returns(int) {
int a;
(((((((, a),)))))) = ((1, 2), 3);
}
}
@@ -0,0 +1,7 @@
pragma experimental SMTChecker;
contract C {
function f2() public pure returns(int) {
int a;
((((((, a)))),)) = ((1, 2), 3);
}
}
@@ -0,0 +1,7 @@
pragma experimental SMTChecker;
contract C {
function f2() public pure returns(int) {
int a;
((((((((((((, a))))))),))))) = ((1, 2), 3);
}
}
@@ -0,0 +1,6 @@
pragma experimental SMTChecker;
contract C {
function f() public pure {
(((,))) = ((2),3);
}
}