mirror of
https://github.com/github/codeql.git
synced 2025-12-21 19:26:31 +01:00
Dataflow: Include type in post-stage-5 tail relation.
This commit is contained in:
@@ -2759,10 +2759,10 @@ module Impl<FullStateConfigSig Config> {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private AccessPathApprox getATail(AccessPathApprox apa) {
|
private predicate hasTail(AccessPathApprox apa, DataFlowType t, AccessPathApprox tail) {
|
||||||
exists(TypedContent head, DataFlowType t |
|
exists(TypedContent head |
|
||||||
apa.isCons(head, t, result) and
|
apa.isCons(head, t, tail) and
|
||||||
Stage5::consCand(head, t, result)
|
Stage5::consCand(head, t, tail)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2808,7 +2808,7 @@ module Impl<FullStateConfigSig Config> {
|
|||||||
private int countPotentialAps(AccessPathApprox apa) {
|
private int countPotentialAps(AccessPathApprox apa) {
|
||||||
apa instanceof AccessPathApproxNil and result = 1
|
apa instanceof AccessPathApproxNil and result = 1
|
||||||
or
|
or
|
||||||
result = strictsum(AccessPathApprox tail | tail = getATail(apa) | countAps(tail))
|
result = strictsum(DataFlowType t, AccessPathApprox tail | hasTail(apa, t, tail) | countAps(tail))
|
||||||
}
|
}
|
||||||
|
|
||||||
private newtype TAccessPath =
|
private newtype TAccessPath =
|
||||||
@@ -2817,16 +2817,17 @@ module Impl<FullStateConfigSig Config> {
|
|||||||
exists(AccessPathApproxCons apa |
|
exists(AccessPathApproxCons apa |
|
||||||
not evalUnfold(apa, false) and
|
not evalUnfold(apa, false) and
|
||||||
head = apa.getHead() and
|
head = apa.getHead() and
|
||||||
tail.getApprox() = getATail(apa)
|
hasTail(apa, _, tail.getApprox())
|
||||||
)
|
)
|
||||||
} or
|
} or
|
||||||
TAccessPathCons2(TypedContent head1, TypedContent head2, int len) {
|
TAccessPathCons2(TypedContent head1, TypedContent head2, int len) {
|
||||||
exists(AccessPathApproxCons apa |
|
exists(AccessPathApproxCons apa, AccessPathApprox tail |
|
||||||
evalUnfold(apa, false) and
|
evalUnfold(apa, false) and
|
||||||
not expensiveLen1to2unfolding(apa) and
|
not expensiveLen1to2unfolding(apa) and
|
||||||
apa.len() = len and
|
apa.len() = len and
|
||||||
|
hasTail(apa, _, tail) and
|
||||||
head1 = apa.getHead() and
|
head1 = apa.getHead() and
|
||||||
head2 = getATail(apa).getHead()
|
head2 = tail.getHead()
|
||||||
)
|
)
|
||||||
} or
|
} or
|
||||||
TAccessPathCons1(TypedContent head, int len) {
|
TAccessPathCons1(TypedContent head, int len) {
|
||||||
|
|||||||
Reference in New Issue
Block a user