mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[SMTChecker] Adding a dummy frame to the call stack for the implicit constructor
This commit is contained in:
@@ -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
|
||||
// ----
|
||||
+19
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user