@@ -6,6 +6,7 @@ private import DataFlowPublic
66private import DataFlowDispatch
77private import SsaImpl as SsaImpl
88private import FlowSummaryImpl as FlowSummaryImpl
9+ private import FlowSummaryImplSpecific as FlowSummaryImplSpecific
910
1011/** Gets the callable in which this node occurs. */
1112DataFlowCallable nodeGetEnclosingCallable ( NodeImpl n ) { result = n .getEnclosingCallable ( ) }
@@ -177,7 +178,7 @@ private class Argument extends CfgNodes::ExprCfgNode {
177178 exists ( int i |
178179 this = call .getArgument ( i ) and
179180 not this .getExpr ( ) instanceof BlockArgument and
180- not exists ( this .getExpr ( ) .( Pair ) .getKey ( ) .getConstantValue ( ) .getSymbol ( ) ) and
181+ not this .getExpr ( ) .( Pair ) .getKey ( ) .getConstantValue ( ) .isSymbol ( _ ) and
181182 arg .isPositional ( i )
182183 )
183184 or
@@ -334,16 +335,21 @@ private module Cached {
334335 cached
335336 newtype TContentSet =
336337 TSingletonContent ( Content c ) or
337- TAnyElementContent ( )
338+ TAnyElementContent ( ) or
339+ TElementLowerBoundContent ( int lower ) {
340+ FlowSummaryImplSpecific:: ParsePositions:: isParsedElementLowerBoundPosition ( _, lower )
341+ }
338342
339343 cached
340344 newtype TContent =
341345 TKnownElementContent ( ConstantValue cv ) {
342346 not cv .isInt ( _) or
343347 cv .getInt ( ) in [ 0 .. 10 ]
344348 } or
345- TFieldContent ( string name ) { name = any ( InstanceVariable v ) .getName ( ) } or
346- TUnknownElementContent ( )
349+ TUnknownElementContent ( ) or
350+ TKnownPairValueContent ( ConstantValue cv ) or
351+ TUnknownPairValueContent ( ) or
352+ TFieldContent ( string name ) { name = any ( InstanceVariable v ) .getName ( ) }
347353
348354 /**
349355 * Holds if `e` is an `ExprNode` that may be returned by a call to `c`.
@@ -362,6 +368,8 @@ private module Cached {
362368
363369class TElementContent = TKnownElementContent or TUnknownElementContent ;
364370
371+ class TPairValueContent = TKnownPairValueContent or TUnknownPairValueContent ;
372+
365373import Cached
366374
367375/** Holds if `n` should be hidden from path explanations. */
@@ -818,6 +826,25 @@ predicate storeStep(Node node1, ContentSet c, Node node2) {
818826 ) .getReceiver ( )
819827 or
820828 FlowSummaryImpl:: Private:: Steps:: summaryStoreStep ( node1 , c , node2 )
829+ or
830+ // Needed for pairs passed into method calls where the key is not a symbol,
831+ // that is, where it is not a keyword argument.
832+ node2 .asExpr ( ) =
833+ any ( CfgNodes:: ExprNodes:: PairCfgNode pair |
834+ exists ( CfgNodes:: ExprCfgNode key |
835+ key = pair .getKey ( ) and
836+ pair .getValue ( ) = node1 .asExpr ( )
837+ |
838+ exists ( ConstantValue cv |
839+ cv = key .getConstantValue ( ) and
840+ not cv .isSymbol ( _) and // handled as a keyword argument
841+ c .isSingleton ( TKnownPairValueContent ( cv ) )
842+ )
843+ or
844+ not exists ( key .getConstantValue ( ) ) and
845+ c .isSingleton ( TUnknownPairValueContent ( ) )
846+ )
847+ )
821848}
822849
823850/**
0 commit comments