mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[SMTChecker] Support address type conversion with literals
This commit is contained in:
@@ -17,5 +17,3 @@ contract C
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning 5084: (205-215): Type conversion is not yet fully supported and might yield false positives.
|
||||
// Warning 5084: (205-215): Type conversion is not yet fully supported and might yield false positives.
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
contract C {
|
||||
address x; // We know that this is "zero initialised".
|
||||
function f() public view {
|
||||
address a = address(0);
|
||||
assert(x == address(0));
|
||||
assert(x == a);
|
||||
}
|
||||
|
||||
function g() public pure {
|
||||
address a = address(0);
|
||||
address b = address(1);
|
||||
address c = address(0);
|
||||
address d = a;
|
||||
address e = address(0x12345678);
|
||||
assert(c == d);
|
||||
assert(a == c);
|
||||
assert(e == address(305419896));
|
||||
// This is untrue.
|
||||
assert(a == b);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning 6328: (487-501): Assertion violation happens here.
|
||||
@@ -11,4 +11,3 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning 5084: (142-152): Type conversion is not yet fully supported and might yield false positives.
|
||||
|
||||
Reference in New Issue
Block a user