C++: We don't need to check type equivalence at the end anymore: the dataflow state now precisely tracks the types.

This commit is contained in:
Mathias Vorreiter Pedersen
2023-03-07 14:29:39 +00:00
parent ce6366f023
commit f2b311a008

View File

@@ -82,15 +82,7 @@ predicate introducesNewField(Class derived, Class base) {
module CastToPointerArithFlow = DataFlow::MakeWithState<CastToPointerArithFlowConfig>;
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"