mirror of
https://github.com/github/codeql.git
synced 2026-05-02 12:15:17 +02:00
Java: Restrict attention to integral types in IntMultToLong.
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
|
||||
| **Query** | **Expected impact** | **Change** |
|
||||
|----------------------------|------------------------|------------------------------------------------------------------|
|
||||
| Result of multiplication cast to wider type (`java/integer-multiplication-cast-to-long`) | Fewer results | Results involving conversions to `float` or `double` are no longer reported, as they were almost exclusively false positives. |
|
||||
|
||||
## Changes to QL libraries
|
||||
|
||||
|
||||
@@ -47,6 +47,8 @@ where
|
||||
e.getType() = sourceType and
|
||||
c.getConversionTarget() = destType and
|
||||
destType.widerThan(sourceType) and
|
||||
// restrict attention to integral types
|
||||
destType instanceof IntegralType and
|
||||
// not a trivial conversion
|
||||
not c.isTrivial() and
|
||||
// not an explicit conversion, which is probably intended by a user
|
||||
|
||||
Reference in New Issue
Block a user