C++: test for bounded bounds in sign analysis

This commit is contained in:
Robert Marsh
2018-11-08 11:38:34 -08:00
parent 1d7e802157
commit 0d9e2098f2
2 changed files with 14 additions and 0 deletions

View File

@@ -5,6 +5,11 @@
| binary_logical_operator.c:2:11:2:25 | Store: ... && ... | positive strictlyPositive |
| binary_logical_operator.c:2:15:2:16 | Constant: 10 | positive strictlyPositive |
| binary_logical_operator.c:3:7:3:7 | Load: b | positive |
| bounded_bounds.c:3:12:3:12 | Load: x | negative strictlyNegative |
| bounded_bounds.c:3:12:3:12 | Store: x | negative strictlyNegative |
| bounded_bounds.c:5:7:5:7 | Load: x | positive |
| bounded_bounds.c:6:11:6:11 | Load: y | positive strictlyPositive |
| bounded_bounds.c:6:11:6:11 | Store: y | positive strictlyPositive |
| inline_assembly.c:9:23:9:23 | Uninitialized: definition of y | positive |
| inline_assembly.c:10:3:10:7 | Store: ... = ... | positive strictlyPositive |
| inline_assembly.c:10:7:10:7 | Constant: (unsigned int)... | positive strictlyPositive |

View File

@@ -0,0 +1,9 @@
int f(int x, int y) {
if (x < 0) {
return x;
}
if (x < y) {
return y; // y is strictly positive because of the bound on x above
}
return 0;
}