[SMTChecker] More precise creation of verification targets.

This commit is contained in:
Martin Blicha
2020-10-30 19:11:28 +01:00
parent be02db4950
commit c1a57ffbfe
39 changed files with 236 additions and 214 deletions
@@ -8,4 +8,4 @@ contract C {
}
}
// ----
// Warning 2529: (82-89): CHC: Empty array "pop" detected here.
// Warning 2529: (82-89): CHC: Empty array "pop" happens here.
@@ -8,4 +8,4 @@ contract C {
}
}
// ----
// Warning 2529: (82-89): CHC: Empty array "pop" detected here.
// Warning 2529: (82-89): CHC: Empty array "pop" happens here.
@@ -8,5 +8,5 @@ contract C {
}
}
// ----
// Warning 2529: (82-89): CHC: Empty array "pop" detected here.
// Warning 2529: (93-100): CHC: Empty array "pop" detected here.
// Warning 2529: (82-89): CHC: Empty array "pop" happens here.
// Warning 2529: (93-100): CHC: Empty array "pop" happens here.
@@ -8,4 +8,4 @@ contract C {
}
}
// ----
// Warning 2529: (94-101): CHC: Empty array "pop" detected here.
// Warning 2529: (94-101): CHC: Empty array "pop" happens here.
@@ -11,4 +11,4 @@ contract C {
}
}
// ----
// Warning 2529: (122-129): CHC: Empty array "pop" detected here.
// Warning 2529: (122-129): CHC: Empty array "pop" happens here.
@@ -11,4 +11,4 @@ contract C {
}
}
// ----
// Warning 2529: (127-134): CHC: Empty array "pop" detected here.
// Warning 2529: (127-134): CHC: Empty array "pop" happens here.
@@ -13,4 +13,4 @@ contract C {
}
}
// ----
// Warning 2529: (82-89): CHC: Empty array "pop" detected here.
// Warning 2529: (82-89): CHC: Empty array "pop" happens here.
@@ -7,4 +7,4 @@ contract C {
}
}
// ----
// Warning 2529: (82-89): CHC: Empty array "pop" detected here.
// Warning 2529: (82-89): CHC: Empty array "pop" happens here.
@@ -9,4 +9,4 @@ contract C {
}
}
// ----
// Warning 2529: (111-121): CHC: Empty array "pop" detected here.
// Warning 2529: (111-121): CHC: Empty array "pop" happens here.
@@ -7,4 +7,4 @@ contract C {
}
}
// ----
// Warning 2529: (76-83): CHC: Empty array "pop" detected here.
// Warning 2529: (76-83): CHC: Empty array "pop" happens here.
@@ -11,4 +11,4 @@ contract C {
}
}
// ----
// Warning 2529: (150-157): CHC: Empty array "pop" detected here.
// Warning 2529: (150-157): CHC: Empty array "pop" happens here.
@@ -18,6 +18,6 @@ contract A is B {
}
}
// ----
// Warning 4984: (198-203): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 4984: (207-212): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 4984: (198-203): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 4984: (230-235): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
@@ -13,5 +13,5 @@ contract C {
}
}
// ----
// Warning 4984: (115-120): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 6328: (162-176): CHC: Assertion violation happens here.
// Warning 4984: (115-120): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
@@ -21,4 +21,5 @@ contract B is A {
}
}
// ----
// Warning 6328: (B.sol:71-85): CHC: Assertion violation happens here.
// Warning 6328: (C.sol:103-117): CHC: Assertion violation happens here.
@@ -15,4 +15,6 @@ contract C
}
// ----
// Warning 4984: (176-181): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here.
// Warning 6328: (296-309): CHC: Assertion violation might happen here.
// Warning 2661: (176-181): BMC: Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 4661: (296-309): BMC: Assertion violation happens here.
@@ -16,5 +16,7 @@ contract LoopFor2 {
}
}
// ----
// Warning 4984: (252-257): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here.
// Warning 4984: (232-238): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here.
// Warning 6328: (373-392): CHC: Assertion violation happens here.
// Warning 6328: (396-415): CHC: Assertion violation happens here.
@@ -20,3 +20,5 @@ contract LoopFor2 {
// ====
// SMTSolvers: z3
// ----
// Warning 4984: (245-250): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here.
// Warning 4984: (225-231): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here.
@@ -19,4 +19,6 @@ contract LoopFor2 {
}
}
// ----
// Warning 4984: (236-241): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here.
// Warning 4984: (216-222): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here.
// Warning 6328: (363-382): CHC: Assertion violation happens here.
@@ -19,5 +19,7 @@ contract LoopFor2 {
}
}
// ----
// Warning 4984: (237-242): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here.
// Warning 4984: (217-223): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here.
// Warning 6328: (341-360): CHC: Assertion violation happens here.
// Warning 6328: (364-383): CHC: Assertion violation happens here.
@@ -14,12 +14,12 @@ contract LoopFor2 {
c[i] = b[i];
++i;
}
assert(b[0] == c[0]);
//assert(b[0] == c[0]); // Removed because of Spacer's nondeterminism
assert(a[0] == 900);
assert(b[0] == 900);
}
}
// ----
// Warning 4984: (229-234): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here.
// Warning 6328: (290-309): CHC: Assertion violation happens here.
// Warning 6328: (313-332): CHC: Assertion violation happens here.
// Warning 6328: (338-357): CHC: Assertion violation happens here.
// Warning 6328: (361-380): CHC: Assertion violation happens here.
@@ -0,0 +1,19 @@
pragma experimental SMTChecker;
contract C
{
uint x;
modifier m {
require(x == 0);
_;
x = x + 1;
assert(x <= 2);
}
function f() m m public {
x = x + 1;
}
}
// ----
// Warning 6328: (109-123): CHC: Assertion violation happens here.
@@ -7,14 +7,10 @@ contract C {
require(b[b.length - 1] == 0xaa);
assert(bytes(b[10:]).length == 20);
assert(bytes(b[10:])[0] == 0xff);
assert(bytes(b[10:])[5] == 0xff);
//assert(bytes(b[10:])[5] == 0xff); // Removed because of Spacer's nondeterminism
assert(bytes(b[10:])[19] == 0xaa);
}
}
// ----
// Warning 6328: (221-253): CHC: Assertion violation might happen here.
// Warning 6328: (257-289): CHC: Assertion violation might happen here.
// Warning 6328: (293-326): CHC: Assertion violation might happen here.
// Warning 4661: (221-253): BMC: Assertion violation happens here.
// Warning 4661: (257-289): BMC: Assertion violation happens here.
// Warning 4661: (293-326): BMC: Assertion violation happens here.
@@ -14,5 +14,6 @@ contract C
}
}
// ----
// Warning 4984: (109-116): CHC: Overflow (resulting value larger than 255) happens here.
// Warning 4984: (154-159): CHC: Overflow (resulting value larger than 255) happens here.
// Warning 4984: (185-192): CHC: Overflow (resulting value larger than 255) happens here.
@@ -7,3 +7,5 @@ contract C
return x + y;
}
}
// ----
// Warning 4984: (115-120): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
@@ -8,3 +8,5 @@ contract C
return z;
}
}
// ----
// Warning 4984: (116-121): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
@@ -8,4 +8,5 @@ contract C {
}
// ----
// Warning 3944: (111-116): CHC: Underflow (resulting value less than -57896044618658097711785492504343953926634992332820282019728792003956564819968) happens here.
// Warning 4984: (111-116): CHC: Overflow (resulting value larger than 0x80 * 2**248 - 1) happens here.
// Warning 3944: (133-138): CHC: Underflow (resulting value less than -57896044618658097711785492504343953926634992332820282019728792003956564819968) happens here.
@@ -6,3 +6,5 @@ contract C {
return x + y;
}
}
// ----
// Warning 4984: (114-119): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
@@ -15,12 +15,12 @@ contract C
}
}
// ----
// Warning 4984: (311-316): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 6328: (79-115): CHC: Assertion violation happens here.
// Warning 6328: (119-161): CHC: Assertion violation happens here.
// Warning 6328: (165-204): CHC: Assertion violation happens here.
// Warning 6328: (208-240): CHC: Assertion violation happens here.
// Warning 6328: (244-275): CHC: Assertion violation happens here.
// Warning 4984: (311-316): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 6328: (304-332): CHC: Assertion violation happens here.
// Warning 6328: (336-364): CHC: Assertion violation happens here.
// Warning 6328: (368-391): CHC: Assertion violation happens here.
@@ -7,4 +7,3 @@ contract C {
}
// ----
// Warning 7650: (128-137): Assertion checker does not yet support this expression.
// Warning 4661: (141-155): BMC: Assertion violation happens here.
@@ -21,5 +21,5 @@ contract C {
}
}
// ----
// Warning 2529: (121-130): CHC: Empty array "pop" detected here.
// Warning 2529: (121-130): CHC: Empty array "pop" happens here.
// Warning 6328: (230-254): CHC: Assertion violation happens here.
@@ -18,5 +18,5 @@ contract C {
}
}
// ----
// Warning 2529: (133-142): CHC: Empty array "pop" detected here.
// Warning 2529: (133-142): CHC: Empty array "pop" happens here.
// Warning 6328: (189-213): CHC: Assertion violation happens here.
@@ -4,4 +4,4 @@ contract C {
function f() public { (a).pop();}
}
// ----
// Warning 2529: (78-87): CHC: Empty array "pop" detected here.
// Warning 2529: (78-87): CHC: Empty array "pop" happens here.
@@ -4,4 +4,4 @@ contract C {
function f() public { (((((a))))).pop();}
}
// ----
// Warning 2529: (78-95): CHC: Empty array "pop" detected here.
// Warning 2529: (78-95): CHC: Empty array "pop" happens here.
@@ -15,4 +15,3 @@ contract C
}
}
// ----
// Warning 4984: (152-157): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.