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) {
10641064 // absolute value. Since `abs(x) = max(-x,x)` this is equivalent to
10651065 // adding `-rhsLB` to the set of upper bounds.
10661066 exists ( float rhsLB |
1067- rhsLB = getFullyConvertedLowerBounds ( remExpr .getAnOperand ( ) ) and
1067+ rhsLB = getFullyConvertedLowerBounds ( remExpr .getRightOperand ( ) ) and
10681068 not rhsLB >= 0
10691069 |
10701070 result = - rhsLB
Original file line number Diff line number Diff line change 593593| test.c:658:7:658:7 | u | 0 |
594594| test.c:659:9:659:9 | u | 0 |
595595| 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 |
597597| test.cpp:10:7:10:7 | b | -2147483648 |
598598| test.cpp:11:5:11:5 | x | -2147483648 |
599599| 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) {
662662
663663void test_mod (int s ) {
664664 int s2 = s % 5 ;
665- out (s2 ); // -4 .. 4 [BUG: is -max .. max ]
665+ out (s2 ); // -4 .. 4 [BUG: is -5 .. 5 ]
666666}
Original file line number Diff line number Diff line change 593593| test.c:658:7:658:7 | u | 0 |
594594| test.c:659:9:659:9 | u | 4294967295 |
595595| 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 |
597597| test.cpp:10:7:10:7 | b | 2147483647 |
598598| test.cpp:11:5:11:5 | x | 2147483647 |
599599| test.cpp:13:10:13:10 | x | 2147483647 |
You can’t perform that action at this time.
0 commit comments