Skip to content

Commit 58cd165

Browse files
committed
Dataflow: Fix forceHighPrecision for length-2 prefixes.
1 parent d46b2a3 commit 58cd165

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl.qll

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2758,12 +2758,21 @@ module Impl<FullStateConfigSig Config> {
27582758
)
27592759
}
27602760

2761+
private predicate forceUnfold(AccessPathApprox apa) {
2762+
forceHighPrecision(apa.getHead())
2763+
or
2764+
exists(Content c2 |
2765+
apa = TConsCons(_, _, c2, _) and
2766+
forceHighPrecision(c2)
2767+
)
2768+
}
2769+
27612770
/**
27622771
* Holds with `unfold = false` if a precise head-tail representation of `apa` is
27632772
* expected to be expensive. Holds with `unfold = true` otherwise.
27642773
*/
27652774
private predicate evalUnfold(AccessPathApprox apa, boolean unfold) {
2766-
if forceHighPrecision(apa.getHead())
2775+
if forceUnfold(apa)
27672776
then unfold = true
27682777
else
27692778
exists(int aps, int nodes, int apLimit, int tupleLimit |

0 commit comments

Comments
 (0)