@@ -484,7 +484,7 @@ module VariableCapture {
484484
485485/** Provides logic related to SSA. */
486486module SsaFlow {
487- module Impl = SsaImpl:: DataFlowIntegration;
487+ private module Impl = SsaImpl:: DataFlowIntegration;
488488
489489 Impl:: Node asNode ( Node n ) {
490490 n = TSsaNode ( result )
@@ -497,8 +497,8 @@ module SsaFlow {
497497 TExplicitParameterNode ( result .( Impl:: ParameterNode ) .getParameter ( ) ) = n
498498 }
499499
500- predicate localFlowStep ( SsaImpl:: DefinitionExt def , Node nodeFrom , Node nodeTo ) {
501- Impl:: localFlowStep ( def , asNode ( nodeFrom ) , asNode ( nodeTo ) )
500+ predicate localFlowStep ( SsaImpl:: DefinitionExt def , Node nodeFrom , Node nodeTo , boolean isUseStep ) {
501+ Impl:: localFlowStep ( def , asNode ( nodeFrom ) , asNode ( nodeTo ) , isUseStep )
502502 }
503503
504504 predicate localMustFlowStep ( SsaImpl:: DefinitionExt def , Node nodeFrom , Node nodeTo ) {
@@ -738,10 +738,13 @@ predicate simpleLocalFlowStep(Node nodeFrom, Node nodeTo, string model) {
738738 (
739739 LocalFlow:: localFlowStepCommon ( nodeFrom , nodeTo )
740740 or
741- exists ( SsaImpl:: DefinitionExt def |
742- SsaFlow:: localFlowStep ( def , nodeFrom , nodeTo ) and
741+ exists ( SsaImpl:: DefinitionExt def , boolean isUseStep |
742+ SsaFlow:: localFlowStep ( def , nodeFrom , nodeTo , isUseStep ) and
743743 not LocalFlow:: usesInstanceField ( def ) and
744- not def instanceof VariableCapture:: CapturedSsaDefinitionExt and
744+ not def instanceof VariableCapture:: CapturedSsaDefinitionExt
745+ |
746+ isUseStep = false
747+ or
745748 not FlowSummaryImpl:: Private:: Steps:: prohibitsUseUseFlow ( nodeFrom , _)
746749 )
747750 or
@@ -1008,7 +1011,7 @@ private module Cached {
10081011 cached
10091012 newtype TNode =
10101013 TExprNode ( ControlFlow:: Nodes:: ElementNode cfn ) { cfn .getAstNode ( ) instanceof Expr } or
1011- TSsaNode ( SsaFlow :: Impl :: SsaNode node ) or
1014+ TSsaNode ( SsaImpl :: DataFlowIntegration :: SsaNode node ) or
10121015 TAssignableDefinitionNode ( AssignableDefinition def , ControlFlow:: Node cfn ) {
10131016 cfn = def .getExpr ( ) .getAControlFlowNode ( )
10141017 } or
@@ -1073,7 +1076,7 @@ private module Cached {
10731076 predicate localFlowStepImpl ( Node nodeFrom , Node nodeTo ) {
10741077 LocalFlow:: localFlowStepCommon ( nodeFrom , nodeTo )
10751078 or
1076- SsaFlow:: localFlowStep ( _, nodeFrom , nodeTo )
1079+ SsaFlow:: localFlowStep ( _, nodeFrom , nodeTo , _ )
10771080 or
10781081 // Simple flow through library code is included in the exposed local
10791082 // step relation, even though flow is technically inter-procedural
@@ -1178,7 +1181,7 @@ predicate nodeIsHidden(Node n) {
11781181
11791182/** An SSA node. */
11801183abstract class SsaNode extends NodeImpl , TSsaNode {
1181- SsaFlow :: Impl :: SsaNode node ;
1184+ SsaImpl :: DataFlowIntegration :: SsaNode node ;
11821185 SsaImpl:: DefinitionExt def ;
11831186
11841187 SsaNode ( ) {
@@ -1205,7 +1208,7 @@ abstract class SsaNode extends NodeImpl, TSsaNode {
12051208
12061209/** An (extended) SSA definition, viewed as a node in a data flow graph. */
12071210class SsaDefinitionExtNode extends SsaNode {
1208- override SsaFlow :: Impl :: SsaDefinitionExtNode node ;
1211+ override SsaImpl :: DataFlowIntegration :: SsaDefinitionExtNode node ;
12091212}
12101213
12111214/**
@@ -1248,7 +1251,7 @@ class SsaDefinitionExtNode extends SsaNode {
12481251 * both inputs into the phi read node after the outer condition are guarded.
12491252 */
12501253class SsaInputNode extends SsaNode {
1251- override SsaFlow :: Impl :: SsaInputNode node ;
1254+ override SsaImpl :: DataFlowIntegration :: SsaInputNode node ;
12521255}
12531256
12541257/** A definition, viewed as a node in a data flow graph. */
@@ -2798,7 +2801,7 @@ private predicate delegateCreationStep(Node nodeFrom, Node nodeTo) {
27982801/** Extra data-flow steps needed for lambda flow analysis. */
27992802predicate additionalLambdaFlowStep ( Node nodeFrom , Node nodeTo , boolean preservesValue ) {
28002803 exists ( SsaImpl:: DefinitionExt def |
2801- SsaFlow:: localFlowStep ( def , nodeFrom , nodeTo ) and
2804+ SsaFlow:: localFlowStep ( def , nodeFrom , nodeTo , _ ) and
28022805 preservesValue = true
28032806 |
28042807 LocalFlow:: usesInstanceField ( def )
0 commit comments