We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9a9f794 commit 63f50a9Copy full SHA for 63f50a9
cpp/ql/lib/semmle/code/cpp/commons/Printf.qll
@@ -1104,13 +1104,9 @@ class FormatLiteral extends Literal {
1104
|
1105
cand =
1106
max(float cand0 |
1107
- (
1108
- if lower < 0
1109
- then
1110
- // Calculate the value of `(unsigned)lower`.
1111
- cand0 = 2.pow(any(IntType t | t.isUnsigned()).getSize() * 8) + lower
1112
- else cand0 = lower
1113
- )
+ // If lower can be negative we use `(unsigned)-1` as the candidate value.
+ lower < 0 and
+ cand0 = 2.pow(any(IntType t | t.isUnsigned()).getSize() * 8)
1114
or
1115
cand0 = upperBound(arg.getFullyConverted())
1116
)
0 commit comments