Apply suggestions from code review

Co-authored-by: Tom Hvitved <hvitved@github.com>
This commit is contained in:
Geoffrey White
2025-11-03 09:38:43 +00:00
committed by GitHub
parent 8548c167be
commit c381153125

View File

@@ -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
) )
} }
} }