File tree Expand file tree Collapse file tree 4 files changed +4
-4
lines changed
src/semmle/code/cpp/rangeanalysis
test/library-tests/rangeanalysis/SimpleRangeAnalysis Expand file tree Collapse file tree 4 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1064,7 +1064,7 @@ private float getUpperBoundsImpl(Expr expr) {
1064
1064
// absolute value. Since `abs(x) = max(-x,x)` this is equivalent to
1065
1065
// adding `-rhsLB` to the set of upper bounds.
1066
1066
exists ( float rhsLB |
1067
- rhsLB = getFullyConvertedLowerBounds ( remExpr .getAnOperand ( ) ) and
1067
+ rhsLB = getFullyConvertedLowerBounds ( remExpr .getRightOperand ( ) ) and
1068
1068
not rhsLB >= 0
1069
1069
|
1070
1070
result = - rhsLB
Original file line number Diff line number Diff line change 593
593
| test.c:658:7:658:7 | u | 0 |
594
594
| test.c:659:9:659:9 | u | 0 |
595
595
| test.c:664:12:664:12 | s | -2147483648 |
596
- | test.c:665:7:665:8 | s2 | -2147483648 |
596
+ | test.c:665:7:665:8 | s2 | -5 |
597
597
| test.cpp:10:7:10:7 | b | -2147483648 |
598
598
| test.cpp:11:5:11:5 | x | -2147483648 |
599
599
| test.cpp:13:10:13:10 | x | -2147483648 |
Original file line number Diff line number Diff line change @@ -662,5 +662,5 @@ void guard_bound_out_of_range(void) {
662
662
663
663
void test_mod (int s ) {
664
664
int s2 = s % 5 ;
665
- out (s2 ); // -4 .. 4 [BUG: is -max .. max ]
665
+ out (s2 ); // -4 .. 4 [BUG: is -5 .. 5 ]
666
666
}
Original file line number Diff line number Diff line change 593
593
| test.c:658:7:658:7 | u | 0 |
594
594
| test.c:659:9:659:9 | u | 4294967295 |
595
595
| test.c:664:12:664:12 | s | 2147483647 |
596
- | test.c:665:7:665:8 | s2 | 2147483647 |
596
+ | test.c:665:7:665:8 | s2 | 5 |
597
597
| test.cpp:10:7:10:7 | b | 2147483647 |
598
598
| test.cpp:11:5:11:5 | x | 2147483647 |
599
599
| test.cpp:13:10:13:10 | x | 2147483647 |
You can’t perform that action at this time.
0 commit comments