[SMTChecker] Adding a dummy frame to the call stack for the implicit constructor

This commit is contained in:
Martin Blicha
2020-11-16 22:46:17 +01:00
parent d7814358a6
commit 07427c798c
4 changed files with 62 additions and 23 deletions
@@ -0,0 +1,21 @@
pragma experimental SMTChecker;
contract C {
uint x = initX();
function initX() internal pure returns (uint) {
return 42;
}
}
contract D is C {
uint y;
constructor() {
assert(x == 42);
y = x;
}
}
// ====
// SMTEngine: bmc
// ----
@@ -0,0 +1,19 @@
pragma experimental SMTChecker;
contract C {
uint x = initX();
uint y = initY();
function initX() internal pure returns (uint) {
return 42;
}
function initY() internal view returns (uint) {
assert(x == 42);
return x;
}
}
// ====
// SMTEngine: bmc
// ----
// Warning 4661: (205-220): BMC: Assertion violation happens here.
@@ -22,4 +22,4 @@ contract C {
// Warning 4144: (217-222): BMC: Underflow (resulting value less than 0) happens here.
// Warning 2661: (293-298): BMC: Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 3046: (369-374): BMC: Division by zero happens here.
// Warning 6084: (68-73): BMC: Underflow (resulting value less than 0) happens here.
// Warning 4144: (68-73): BMC: Underflow (resulting value less than 0) happens here.