@@ -446,41 +446,35 @@ private class CapturePostUpdateNode extends PostUpdateNode, CaptureNode {
446446
447447final class CastNode = NaNode ;
448448
449- /** A collection of cached types and predicates to be evaluated in the same stage. */
450- cached
451- private module Cached {
452- private import codeql.rust.internal.CachedStages
453-
454- cached
455- newtype TNode =
456- TExprNode ( ExprCfgNode n ) { Stages:: DataFlowStage:: ref ( ) } or
457- TSourceParameterNode ( ParamBaseCfgNode p ) or
458- TPatNode ( PatCfgNode p ) or
459- TNameNode ( NameCfgNode n ) { n .getName ( ) = any ( Variable v ) .getName ( ) } or
460- TExprPostUpdateNode ( ExprCfgNode e ) {
461- isArgumentForCall ( e , _, _)
462- or
463- lambdaCallExpr ( _, _, e )
464- or
465- lambdaCreationExpr ( e .getExpr ( ) , _)
466- or
467- // Whenever `&mut e` has a post-update node we also create one for `e`.
468- // E.g., for `e` in `f(..., &mut e, ...)` or `*(&mut e) = ...`.
469- e = any ( RefExprCfgNode ref | ref .isMut ( ) and exists ( TExprPostUpdateNode ( ref ) ) ) .getExpr ( )
470- or
471- e =
472- [
473- any ( IndexExprCfgNode i ) .getBase ( ) , any ( FieldExprCfgNode access ) .getExpr ( ) ,
474- any ( TryExprCfgNode try ) .getExpr ( ) ,
475- any ( PrefixExprCfgNode pe | pe .getOperatorName ( ) = "*" ) .getExpr ( ) ,
476- any ( AwaitExprCfgNode a ) .getExpr ( ) , any ( MethodCallExprCfgNode mc ) .getReceiver ( )
477- ]
478- } or
479- TReceiverNode ( MethodCallExprCfgNode mc , Boolean isPost ) or
480- TSsaNode ( SsaImpl:: DataFlowIntegration:: SsaNode node ) or
481- TFlowSummaryNode ( FlowSummaryImpl:: Private:: SummaryNode sn ) or
482- TClosureSelfReferenceNode ( CfgScope c ) { lambdaCreationExpr ( c , _) } or
483- TCaptureNode ( VariableCapture:: Flow:: SynthesizedCaptureNode cn )
484- }
449+ private import codeql.rust.internal.CachedStages
485450
486- import Cached
451+ cached
452+ newtype TNode =
453+ TExprNode ( ExprCfgNode n ) { Stages:: DataFlowStage:: ref ( ) } or
454+ TSourceParameterNode ( ParamBaseCfgNode p ) or
455+ TPatNode ( PatCfgNode p ) or
456+ TNameNode ( NameCfgNode n ) { n .getName ( ) = any ( Variable v ) .getName ( ) } or
457+ TExprPostUpdateNode ( ExprCfgNode e ) {
458+ isArgumentForCall ( e , _, _)
459+ or
460+ lambdaCallExpr ( _, _, e )
461+ or
462+ lambdaCreationExpr ( e .getExpr ( ) , _)
463+ or
464+ // Whenever `&mut e` has a post-update node we also create one for `e`.
465+ // E.g., for `e` in `f(..., &mut e, ...)` or `*(&mut e) = ...`.
466+ e = any ( RefExprCfgNode ref | ref .isMut ( ) and exists ( TExprPostUpdateNode ( ref ) ) ) .getExpr ( )
467+ or
468+ e =
469+ [
470+ any ( IndexExprCfgNode i ) .getBase ( ) , any ( FieldExprCfgNode access ) .getExpr ( ) ,
471+ any ( TryExprCfgNode try ) .getExpr ( ) ,
472+ any ( PrefixExprCfgNode pe | pe .getOperatorName ( ) = "*" ) .getExpr ( ) ,
473+ any ( AwaitExprCfgNode a ) .getExpr ( ) , any ( MethodCallExprCfgNode mc ) .getReceiver ( )
474+ ]
475+ } or
476+ TReceiverNode ( MethodCallExprCfgNode mc , Boolean isPost ) or
477+ TSsaNode ( SsaImpl:: DataFlowIntegration:: SsaNode node ) or
478+ TFlowSummaryNode ( FlowSummaryImpl:: Private:: SummaryNode sn ) or
479+ TClosureSelfReferenceNode ( CfgScope c ) { lambdaCreationExpr ( c , _) } or
480+ TCaptureNode ( VariableCapture:: Flow:: SynthesizedCaptureNode cn )
0 commit comments