@@ -4364,13 +4364,15 @@ module MakeImpl<InputSig Lang> {
4364
4364
private predicate flagDisable ( ) { none ( ) }
4365
4365
4366
4366
module FlowExplorationFwd< explorationLimitSig / 0 explorationLimit> {
4367
- import FlowExploration< explorationLimit / 0 , flagEnable / 0 , flagDisable / 0 >
4367
+ private import FlowExploration< explorationLimit / 0 , flagEnable / 0 , flagDisable / 0 >
4368
+ import Public
4368
4369
4369
4370
predicate partialFlow = partialFlowFwd / 3 ;
4370
4371
}
4371
4372
4372
4373
module FlowExplorationRev< explorationLimitSig / 0 explorationLimit> {
4373
- import FlowExploration< explorationLimit / 0 , flagDisable / 0 , flagEnable / 0 >
4374
+ private import FlowExploration< explorationLimit / 0 , flagDisable / 0 , flagEnable / 0 >
4375
+ import Public
4374
4376
4375
4377
predicate partialFlow = partialFlowRev / 3 ;
4376
4378
}
@@ -4617,96 +4619,100 @@ module MakeImpl<InputSig Lang> {
4617
4619
partialPathStep1 ( _, _, _, _, _, _, _, _, t0 , t , ap ) and t0 != t
4618
4620
}
4619
4621
4620
- /**
4621
- * A `Node` augmented with a call context, an access path, and a configuration.
4622
- */
4623
- class PartialPathNode extends TPartialPathNode {
4624
- /** Gets a textual representation of this element. */
4625
- string toString ( ) { result = this .getNodeEx ( ) .toString ( ) + this .ppType ( ) + this .ppAp ( ) }
4626
-
4622
+ module Public {
4627
4623
/**
4628
- * Gets a textual representation of this element, including a textual
4629
- * representation of the call context.
4624
+ * A `Node` augmented with a call context, an access path, and a configuration.
4630
4625
*/
4631
- string toStringWithContext ( ) {
4632
- result = this .getNodeEx ( ) .toString ( ) + this .ppType ( ) + this .ppAp ( ) + this .ppCtx ( )
4633
- }
4626
+ class PartialPathNode extends TPartialPathNode {
4627
+ /** Gets a textual representation of this element. */
4628
+ string toString ( ) { result = this .getNodeEx ( ) .toString ( ) + this .ppType ( ) + this .ppAp ( ) }
4629
+
4630
+ /**
4631
+ * Gets a textual representation of this element, including a textual
4632
+ * representation of the call context.
4633
+ */
4634
+ string toStringWithContext ( ) {
4635
+ result = this .getNodeEx ( ) .toString ( ) + this .ppType ( ) + this .ppAp ( ) + this .ppCtx ( )
4636
+ }
4634
4637
4635
- /**
4636
- * Holds if this element is at the specified location.
4637
- * The location spans column `startcolumn` of line `startline` to
4638
- * column `endcolumn` of line `endline` in file `filepath`.
4639
- * For more information, see
4640
- * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
4641
- */
4642
- predicate hasLocationInfo (
4643
- string filepath , int startline , int startcolumn , int endline , int endcolumn
4644
- ) {
4645
- this .getNodeEx ( ) .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn )
4646
- }
4638
+ /**
4639
+ * Holds if this element is at the specified location.
4640
+ * The location spans column `startcolumn` of line `startline` to
4641
+ * column `endcolumn` of line `endline` in file `filepath`.
4642
+ * For more information, see
4643
+ * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
4644
+ */
4645
+ predicate hasLocationInfo (
4646
+ string filepath , int startline , int startcolumn , int endline , int endcolumn
4647
+ ) {
4648
+ this .getNodeEx ( ) .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn )
4649
+ }
4647
4650
4648
- /** Gets the underlying `Node`. */
4649
- final Node getNode ( ) { this .getNodeEx ( ) .projectToNode ( ) = result }
4651
+ /** Gets the underlying `Node`. */
4652
+ final Node getNode ( ) { this .getNodeEx ( ) .projectToNode ( ) = result }
4650
4653
4651
- FlowState getState ( ) { none ( ) }
4654
+ FlowState getState ( ) { none ( ) }
4652
4655
4653
- private NodeEx getNodeEx ( ) {
4654
- result = this .( PartialPathNodeFwd ) .getNodeEx ( ) or
4655
- result = this .( PartialPathNodeRev ) .getNodeEx ( )
4656
- }
4656
+ private NodeEx getNodeEx ( ) {
4657
+ result = this .( PartialPathNodeFwd ) .getNodeEx ( ) or
4658
+ result = this .( PartialPathNodeRev ) .getNodeEx ( )
4659
+ }
4657
4660
4658
- /** Gets a successor of this node, if any. */
4659
- PartialPathNode getASuccessor ( ) { none ( ) }
4661
+ /** Gets a successor of this node, if any. */
4662
+ PartialPathNode getASuccessor ( ) { none ( ) }
4660
4663
4661
- /**
4662
- * Gets the approximate distance to the nearest source measured in number
4663
- * of interprocedural steps.
4664
- */
4665
- int getSourceDistance ( ) { result = distSrc ( this .getNodeEx ( ) .getEnclosingCallable ( ) ) }
4664
+ /**
4665
+ * Gets the approximate distance to the nearest source measured in number
4666
+ * of interprocedural steps.
4667
+ */
4668
+ int getSourceDistance ( ) { result = distSrc ( this .getNodeEx ( ) .getEnclosingCallable ( ) ) }
4666
4669
4667
- /**
4668
- * Gets the approximate distance to the nearest sink measured in number
4669
- * of interprocedural steps.
4670
- */
4671
- int getSinkDistance ( ) { result = distSink ( this .getNodeEx ( ) .getEnclosingCallable ( ) ) }
4670
+ /**
4671
+ * Gets the approximate distance to the nearest sink measured in number
4672
+ * of interprocedural steps.
4673
+ */
4674
+ int getSinkDistance ( ) { result = distSink ( this .getNodeEx ( ) .getEnclosingCallable ( ) ) }
4672
4675
4673
- private string ppType ( ) {
4674
- this instanceof PartialPathNodeRev and result = ""
4675
- or
4676
- exists ( DataFlowType t | t = this .( PartialPathNodeFwd ) .getType ( ) |
4677
- // The `concat` becomes "" if `ppReprType` has no result.
4678
- result = concat ( " : " + ppReprType ( t ) )
4679
- )
4680
- }
4676
+ private string ppType ( ) {
4677
+ this instanceof PartialPathNodeRev and result = ""
4678
+ or
4679
+ exists ( DataFlowType t | t = this .( PartialPathNodeFwd ) .getType ( ) |
4680
+ // The `concat` becomes "" if `ppReprType` has no result.
4681
+ result = concat ( " : " + ppReprType ( t ) )
4682
+ )
4683
+ }
4681
4684
4682
- private string ppAp ( ) {
4683
- exists ( string s |
4684
- s = this .( PartialPathNodeFwd ) .getAp ( ) .toString ( ) or
4685
- s = this .( PartialPathNodeRev ) .getAp ( ) .toString ( )
4686
- |
4687
- if s = "" then result = "" else result = " " + s
4688
- )
4689
- }
4685
+ private string ppAp ( ) {
4686
+ exists ( string s |
4687
+ s = this .( PartialPathNodeFwd ) .getAp ( ) .toString ( ) or
4688
+ s = this .( PartialPathNodeRev ) .getAp ( ) .toString ( )
4689
+ |
4690
+ if s = "" then result = "" else result = " " + s
4691
+ )
4692
+ }
4690
4693
4691
- private string ppCtx ( ) {
4692
- result = " <" + this .( PartialPathNodeFwd ) .getCallContext ( ) .toString ( ) + ">"
4693
- }
4694
+ private string ppCtx ( ) {
4695
+ result = " <" + this .( PartialPathNodeFwd ) .getCallContext ( ) .toString ( ) + ">"
4696
+ }
4694
4697
4695
- /** Holds if this is a source in a forward-flow path. */
4696
- predicate isFwdSource ( ) { this .( PartialPathNodeFwd ) .isSource ( ) }
4698
+ /** Holds if this is a source in a forward-flow path. */
4699
+ predicate isFwdSource ( ) { this .( PartialPathNodeFwd ) .isSource ( ) }
4697
4700
4698
- /** Holds if this is a sink in a reverse-flow path. */
4699
- predicate isRevSink ( ) { this .( PartialPathNodeRev ) .isSink ( ) }
4700
- }
4701
+ /** Holds if this is a sink in a reverse-flow path. */
4702
+ predicate isRevSink ( ) { this .( PartialPathNodeRev ) .isSink ( ) }
4703
+ }
4701
4704
4702
- /**
4703
- * Provides the query predicates needed to include a graph in a path-problem query.
4704
- */
4705
- module PartialPathGraph {
4706
- /** Holds if `(a,b)` is an edge in the graph of data flow path explanations. */
4707
- query predicate edges ( PartialPathNode a , PartialPathNode b ) { a .getASuccessor ( ) = b }
4705
+ /**
4706
+ * Provides the query predicates needed to include a graph in a path-problem query.
4707
+ */
4708
+ module PartialPathGraph {
4709
+ /** Holds if `(a,b)` is an edge in the graph of data flow path explanations. */
4710
+ query predicate edges ( PartialPathNode a , PartialPathNode b ) { a .getASuccessor ( ) = b }
4711
+ }
4708
4712
}
4709
4713
4714
+ import Public
4715
+
4710
4716
private class PartialPathNodeFwd extends PartialPathNode , TPartialPathNodeFwd {
4711
4717
NodeEx node ;
4712
4718
FlowState state ;
0 commit comments