mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Apply suggestions from code review
Co-authored-by: Tom Hvitved <hvitved@github.com>
This commit is contained in:
@@ -15,12 +15,12 @@ private import codeql.rust.frameworks.stdlib.Builtins
|
|||||||
*/
|
*/
|
||||||
class NumericTypeBarrier extends DataFlow::Node {
|
class NumericTypeBarrier extends DataFlow::Node {
|
||||||
NumericTypeBarrier() {
|
NumericTypeBarrier() {
|
||||||
exists(TypeInference::Type t |
|
exists(StructType t, Struct s |
|
||||||
t = TypeInference::inferType(this.asExpr().getExpr()) and
|
t = TypeInference::inferType(this.asExpr().getExpr()) and
|
||||||
(
|
s = t.getStruct()
|
||||||
t.(StructType).getStruct() instanceof NumericType or
|
|
|
||||||
t.(StructType).getStruct() instanceof Bool
|
s instanceof NumericType or
|
||||||
)
|
s instanceof Bool
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -31,12 +31,12 @@ class NumericTypeBarrier extends DataFlow::Node {
|
|||||||
*/
|
*/
|
||||||
class IntegralOrBooleanTypeBarrier extends DataFlow::Node {
|
class IntegralOrBooleanTypeBarrier extends DataFlow::Node {
|
||||||
IntegralOrBooleanTypeBarrier() {
|
IntegralOrBooleanTypeBarrier() {
|
||||||
exists(TypeInference::Type t |
|
exists(StructType t, Struct s |
|
||||||
t = TypeInference::inferType(this.asExpr().getExpr()) and
|
t = TypeInference::inferType(this.asExpr().getExpr()) and
|
||||||
(
|
s = t.getStruct()
|
||||||
t.(StructType).getStruct() instanceof IntegralType or
|
|
|
||||||
t.(StructType).getStruct() instanceof Bool
|
s instanceof IntegralType or
|
||||||
)
|
s instanceof Bool
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user