File tree Expand file tree Collapse file tree 3 files changed +19
-8
lines changed
test/libsolidity/smtCheckerTests/types Expand file tree Collapse file tree 3 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ Bugfixes:
22
22
* SMTChecker: Fix internal error on fixed bytes index access.
23
23
* SMTChecker: Fix internal error on lvalue unary operators with tuples.
24
24
* SMTChecker: Fix internal error on tuple assignment.
25
+ * SMTChecker: Fix internal error on tuples of one element that have tuple type.
25
26
* SMTChecker: Fix soundness of array `` pop `` .
26
27
* References Resolver: Fix internal bug when using constructor for library.
27
28
* Yul Optimizer: Make function inlining order more resilient to whether or not unrelated source files are present.
Original file line number Diff line number Diff line change @@ -420,8 +420,11 @@ void SMTEncoder::endVisit(TupleExpression const& _tuple)
420
420
_tuple.location (),
421
421
" Assertion checker does not yet implement inline arrays."
422
422
);
423
- else if (_tuple.annotation ().type ->category () == Type::Category::Tuple)
423
+ else if (_tuple.components ().size () == 1 )
424
+ defineExpr (_tuple, expr (*_tuple.components ().front ()));
425
+ else
424
426
{
427
+ solAssert (_tuple.annotation ().type ->category () == Type::Category::Tuple, " " );
425
428
auto const & symbTuple = dynamic_pointer_cast<smt::SymbolicTupleVariable>(m_context.expression (_tuple));
426
429
solAssert (symbTuple, " " );
427
430
auto const & symbComponents = symbTuple->components ();
@@ -445,13 +448,6 @@ void SMTEncoder::endVisit(TupleExpression const& _tuple)
445
448
}
446
449
}
447
450
}
448
- else
449
- {
450
- // / Parenthesized expressions are also TupleExpression regardless their type.
451
- auto const & components = _tuple.components ();
452
- solAssert (components.size () == 1 , " " );
453
- defineExpr (_tuple, expr (*components.front ()));
454
- }
455
451
}
456
452
457
453
void SMTEncoder::endVisit (UnaryOperation const & _op)
Original file line number Diff line number Diff line change
1
+ pragma experimental SMTChecker;
2
+ contract C {
3
+ function g () internal pure returns (uint , uint ) {
4
+ return (2 , 3 );
5
+ }
6
+ function f () public {
7
+ (address (1 ).call ("" ));
8
+ (uint x , uint y ) = ((g ()));
9
+ assert (x == 2 );
10
+ assert (y == 3 );
11
+ }
12
+ }
13
+ // ----
14
+ // Warning 5084: (142-152): Type conversion is not yet fully supported and might yield false positives.
You can’t perform that action at this time.
0 commit comments