File tree Expand file tree Collapse file tree 5 files changed +55
-0
lines changed
test/libsolidity/smtCheckerTests/bmc_coverage Expand file tree Collapse file tree 5 files changed +55
-0
lines changed Original file line number Diff line number Diff line change @@ -587,6 +587,11 @@ void BMC::internalOrExternalFunctionCall(FunctionCall const& _funCall)
587
587
_funCall.location (),
588
588
" BMC does not yet implement this type of function call."
589
589
);
590
+ else if (funType.kind () == FunctionType::Kind::BareStaticCall)
591
+ {
592
+ // Do nothing here.
593
+ // Neither storage nor balances should be modified.
594
+ }
590
595
else
591
596
{
592
597
m_externalFunctionCallHappened = true ;
Original file line number Diff line number Diff line change
1
+ contract C {
2
+ function f (address _a ) public {
3
+ uint b1 = address (this ).balance;
4
+ _a.call ("" );
5
+ uint b2 = address (this ).balance;
6
+ assert (b1 == b2); // should fail
7
+ }
8
+ }
9
+ // ====
10
+ // SMTEngine: bmc
11
+ // ----
12
+ // Warning 9302: (83-94): Return value of low-level calls not used.
13
+ // Warning 4661: (133-149): BMC: Assertion violation happens here.
Original file line number Diff line number Diff line change
1
+ contract C {
2
+ uint x;
3
+ function f (address _a ) public {
4
+ x = 2 ;
5
+ _a.call ("" );
6
+ assert (x == 2 ); // should fail
7
+ }
8
+ }
9
+ // ====
10
+ // SMTEngine: bmc
11
+ // ----
12
+ // Warning 9302: (66-77): Return value of low-level calls not used.
13
+ // Warning 4661: (81-95): BMC: Assertion violation happens here.
Original file line number Diff line number Diff line change
1
+ contract C {
2
+ function f (address _a ) public view {
3
+ uint b1 = address (this ).balance;
4
+ _a.staticcall ("" );
5
+ uint b2 = address (this ).balance;
6
+ assert (b1 == b2); // should hold
7
+ }
8
+ }
9
+ // ====
10
+ // SMTEngine: bmc
11
+ // ----
12
+ // Warning 9302: (88-105): Return value of low-level calls not used.
Original file line number Diff line number Diff line change
1
+ contract C {
2
+ uint x;
3
+ function f (address _a ) public {
4
+ x = 2 ;
5
+ _a.staticcall ("" );
6
+ assert (x == 2 ); // should hold
7
+ }
8
+ }
9
+ // ====
10
+ // SMTEngine: bmc
11
+ // ----
12
+ // Warning 9302: (66-83): Return value of low-level calls not used.
You can’t perform that action at this time.
0 commit comments