@@ -3,6 +3,7 @@ private import semmle.code.java.dataflow.InstanceAccess
33private import semmle.code.java.dataflow.ExternalFlow
44private import semmle.code.java.dataflow.FlowSummary
55private import semmle.code.java.dataflow.TypeFlow
6+ private import semmle.code.java.dataflow.FlowSteps
67private import DataFlowPrivate
78private import DataFlowUtil
89private import FlowSummaryImpl as FlowSummaryImpl
@@ -56,7 +57,8 @@ private module Cached {
5657 } or
5758 TFlowSummaryNode ( FlowSummaryImpl:: Private:: SummaryNode sn ) or
5859 TFieldValueNode ( Field f ) or
59- TCaptureNode ( CaptureFlow:: SynthesizedCaptureNode cn )
60+ TCaptureNode ( CaptureFlow:: SynthesizedCaptureNode cn ) or
61+ TAdditionalNode ( Expr e , string id ) { any ( AdditionalDataFlowNode adfn ) .nodeAt ( e , id ) }
6062
6163 cached
6264 newtype TContent =
@@ -133,6 +135,8 @@ module Public {
133135 result = this .( CaptureNode ) .getTypeImpl ( )
134136 or
135137 result = this .( FieldValueNode ) .getField ( ) .getType ( )
138+ or
139+ result instanceof TypeObject and this instanceof AdditionalNode
136140 }
137141
138142 /** Gets the callable in which this node occurs. */
@@ -335,6 +339,21 @@ module Public {
335339 /** Holds if this is an access to an object's own instance. */
336340 predicate isOwnInstanceAccess ( ) { this .getInstanceAccess ( ) .isOwnInstanceAccess ( ) }
337341 }
342+
343+ /** A node introduced by an extension of `AdditionalDataFlowNode`. */
344+ class AdditionalNode extends Node , TAdditionalNode {
345+ Expr e_ ;
346+ string id_ ;
347+
348+ AdditionalNode ( ) { this = TAdditionalNode ( e_ , id_ ) }
349+
350+ override string toString ( ) { result = e_ .toString ( ) + " (" + id_ + ")" }
351+
352+ override Location getLocation ( ) { result = e_ .getLocation ( ) }
353+
354+ /** Holds if this node was introduced by `AdditionalDataFlowNode.nodeAt(e, id)`. */
355+ predicate nodeAt ( Expr e , string id ) { e = e_ and id = id_ }
356+ }
338357}
339358
340359private import Public
@@ -378,7 +397,8 @@ module Private {
378397 result = nodeGetEnclosingCallable ( n .( ImplicitPostUpdateNode ) .getPreUpdateNode ( ) ) or
379398 result .asSummarizedCallable ( ) = n .( FlowSummaryNode ) .getSummarizedCallable ( ) or
380399 result .asCallable ( ) = n .( CaptureNode ) .getSynthesizedCaptureNode ( ) .getEnclosingCallable ( ) or
381- result .asFieldScope ( ) = n .( FieldValueNode ) .getField ( )
400+ result .asFieldScope ( ) = n .( FieldValueNode ) .getField ( ) or
401+ result .asCallable ( ) = any ( Expr e | n .( AdditionalNode ) .nodeAt ( e , _) ) .getEnclosingCallable ( )
382402 }
383403
384404 /** Holds if `p` is a `ParameterNode` of `c` with position `pos`. */
0 commit comments