@@ -1640,8 +1640,15 @@ predicate localInstructionFlow(Instruction e1, Instruction e2) {
1640
1640
localFlow ( instructionNode ( e1 ) , instructionNode ( e2 ) )
1641
1641
}
1642
1642
1643
+ /**
1644
+ * INTERNAL: Do not use.
1645
+ *
1646
+ * Ideally this module would be private, but the `asExprInternal` predicate is
1647
+ * needed in `DefaultTaintTrackingImpl`. Once `DefaultTaintTrackingImpl` is gone
1648
+ * we can make this module private.
1649
+ */
1643
1650
cached
1644
- private module ExprFlowCached {
1651
+ module ExprFlowCached {
1645
1652
/**
1646
1653
* Holds if `n` is an indirect operand of a `PointerArithmeticInstruction`, and
1647
1654
* `e` is the result of loading from the `PointerArithmeticInstruction`.
@@ -1692,7 +1699,8 @@ private module ExprFlowCached {
1692
1699
* `x[i]` steps to the expression `x[i - 1]` without traversing the
1693
1700
* entire chain.
1694
1701
*/
1695
- private Expr asExpr ( Node n ) {
1702
+ cached
1703
+ Expr asExprInternal ( Node n ) {
1696
1704
isIndirectBaseOfArrayAccess ( n , result )
1697
1705
or
1698
1706
not isIndirectBaseOfArrayAccess ( n , _) and
@@ -1704,7 +1712,7 @@ private module ExprFlowCached {
1704
1712
* dataflow step.
1705
1713
*/
1706
1714
private predicate localStepFromNonExpr ( Node n1 , Node n2 ) {
1707
- not exists ( asExpr ( n1 ) ) and
1715
+ not exists ( asExprInternal ( n1 ) ) and
1708
1716
localFlowStep ( n1 , n2 )
1709
1717
}
1710
1718
@@ -1715,7 +1723,7 @@ private module ExprFlowCached {
1715
1723
pragma [ nomagic]
1716
1724
private predicate localStepsToExpr ( Node n1 , Node n2 , Expr e2 ) {
1717
1725
localStepFromNonExpr * ( n1 , n2 ) and
1718
- e2 = asExpr ( n2 )
1726
+ e2 = asExprInternal ( n2 )
1719
1727
}
1720
1728
1721
1729
/**
@@ -1726,7 +1734,7 @@ private module ExprFlowCached {
1726
1734
exists ( Node mid |
1727
1735
localFlowStep ( n1 , mid ) and
1728
1736
localStepsToExpr ( mid , n2 , e2 ) and
1729
- e1 = asExpr ( n1 )
1737
+ e1 = asExprInternal ( n1 )
1730
1738
)
1731
1739
}
1732
1740
0 commit comments