From f2b311a0087a39e4bccfedb254e38f0ed8da32c2 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Tue, 7 Mar 2023 14:29:39 +0000 Subject: [PATCH] C++: We don't need to check type equivalence at the end anymore: the dataflow state now precisely tracks the types. --- .../Conversion/CastArrayPointerArithmetic.ql | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/cpp/ql/src/Likely Bugs/Conversion/CastArrayPointerArithmetic.ql b/cpp/ql/src/Likely Bugs/Conversion/CastArrayPointerArithmetic.ql index ddd7d61c360..03f622855ab 100644 --- a/cpp/ql/src/Likely Bugs/Conversion/CastArrayPointerArithmetic.ql +++ b/cpp/ql/src/Likely Bugs/Conversion/CastArrayPointerArithmetic.ql @@ -82,15 +82,7 @@ predicate introducesNewField(Class derived, Class base) { module CastToPointerArithFlow = DataFlow::MakeWithState; -pragma[nomagic] -predicate hasFullyConvertedType(CastToPointerArithFlow::PathNode node, Type t) { - getFullyConvertedType(node.getNode()) = t -} - -from CastToPointerArithFlow::PathNode source, CastToPointerArithFlow::PathNode sink, Type t -where - CastToPointerArithFlow::hasFlowPath(pragma[only_bind_into](source), pragma[only_bind_into](sink)) and - hasFullyConvertedType(source, t) and - hasFullyConvertedType(sink, t) +from CastToPointerArithFlow::PathNode source, CastToPointerArithFlow::PathNode sink +where CastToPointerArithFlow::hasFlowPath(source, sink) select sink, source, sink, "This pointer arithmetic may be done with the wrong type because of $@.", source, "this cast"