Skip to content

Commit b1ed72d

Browse files
authored
Merge pull request #20886 from aschackmull/java/rangeanalysis-longliterals
Java: Recognize int-sized long literals.
2 parents 60826bd + 298e4cf commit b1ed72d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

java/ql/lib/semmle/code/java/dataflow/RangeUtils.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ pragma[nomagic]
8686
private predicate constantIntegerExpr(Expr e, int val) {
8787
e.(CompileTimeConstantExpr).getIntValue() = val
8888
or
89+
e.(LongLiteral).getValue().toInt() = val
90+
or
8991
exists(SsaExplicitWrite v, Expr src |
9092
e = v.getARead() and
9193
src = v.getValue() and

0 commit comments

Comments
 (0)