File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
rust/ql/lib/codeql/rust/dataflow/internal Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -145,9 +145,13 @@ final class ArgumentPosition extends ParameterPosition {
145145 * as the synthetic `ReceiverNode` is the argument for the `self` parameter.
146146 */
147147predicate isArgumentForCall ( ExprCfgNode arg , CallCfgNode call , ParameterPosition pos ) {
148- call .getPositionalArgument ( pos .getPosition ( ) ) = arg
149- or
150- call .getReceiver ( ) = arg and pos .isSelf ( ) and not call .getCall ( ) .receiverImplicitlyBorrowed ( )
148+ // TODO: Handle index expressions as calls in data flow.
149+ not call .getCall ( ) instanceof IndexExpr and
150+ (
151+ call .getPositionalArgument ( pos .getPosition ( ) ) = arg
152+ or
153+ call .getReceiver ( ) = arg and pos .isSelf ( ) and not call .getCall ( ) .receiverImplicitlyBorrowed ( )
154+ )
151155}
152156
153157/** Provides logic related to SSA. */
Original file line number Diff line number Diff line change @@ -472,7 +472,11 @@ newtype TNode =
472472 getPostUpdateReverseStep ( any ( PostUpdateNode n ) .getPreUpdateNode ( ) .asExpr ( ) , _)
473473 ]
474474 } or
475- TReceiverNode ( CallCfgNode mc , Boolean isPost ) { mc .getCall ( ) .receiverImplicitlyBorrowed ( ) } or
475+ TReceiverNode ( CallCfgNode mc , Boolean isPost ) {
476+ mc .getCall ( ) .receiverImplicitlyBorrowed ( ) and
477+ // TODO: Handle index expressions as calls in data flow.
478+ not mc .getCall ( ) instanceof IndexExpr
479+ } or
476480 TSsaNode ( SsaImpl:: DataFlowIntegration:: SsaNode node ) or
477481 TFlowSummaryNode ( FlowSummaryImpl:: Private:: SummaryNode sn ) or
478482 TClosureSelfReferenceNode ( CfgScope c ) { lambdaCreationExpr ( c , _) } or
You can’t perform that action at this time.
0 commit comments