Skip to content

Commit f2b311a

Browse files
committed
C++: We don't need to check type equivalence at the end anymore: the dataflow state now precisely tracks the types.
1 parent ce6366f commit f2b311a

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

cpp/ql/src/Likely Bugs/Conversion/CastArrayPointerArithmetic.ql

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,7 @@ predicate introducesNewField(Class derived, Class base) {
8282

8383
module CastToPointerArithFlow = DataFlow::MakeWithState<CastToPointerArithFlowConfig>;
8484

85-
pragma[nomagic]
86-
predicate hasFullyConvertedType(CastToPointerArithFlow::PathNode node, Type t) {
87-
getFullyConvertedType(node.getNode()) = t
88-
}
89-
90-
from CastToPointerArithFlow::PathNode source, CastToPointerArithFlow::PathNode sink, Type t
91-
where
92-
CastToPointerArithFlow::hasFlowPath(pragma[only_bind_into](source), pragma[only_bind_into](sink)) and
93-
hasFullyConvertedType(source, t) and
94-
hasFullyConvertedType(sink, t)
85+
from CastToPointerArithFlow::PathNode source, CastToPointerArithFlow::PathNode sink
86+
where CastToPointerArithFlow::hasFlowPath(source, sink)
9587
select sink, source, sink, "This pointer arithmetic may be done with the wrong type because of $@.",
9688
source, "this cast"

0 commit comments

Comments
 (0)