File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
rust/ql/lib/codeql/rust/dataflow/internal
shared/dataflow/codeql/dataflow/internal Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -168,12 +168,12 @@ private module StepsInput implements Impl::Private::StepsInputSig {
168168 or
169169 exists ( ArgumentPosition pos , Expr arg |
170170 s .head ( ) = Impl:: Private:: SummaryComponent:: parameter ( pos ) and
171- arg = getSourceNodeArgument ( source , s .tail ( ) .head ( ) ) and
171+ arg = getSourceNodeArgument ( source , s .tail ( ) .headOfSingleton ( ) ) and
172172 result .asParameter ( ) = getCallable ( arg ) .getParam ( pos .getPosition ( ) )
173173 )
174174 or
175175 result .( RustDataFlow:: PostUpdateNode ) .getPreUpdateNode ( ) .asExpr ( ) .getExpr ( ) =
176- getSourceNodeArgument ( source , s .head ( ) )
176+ getSourceNodeArgument ( source , s .headOfSingleton ( ) )
177177 }
178178
179179 RustDataFlow:: Node getSinkNode ( Input:: SinkBase sink , Impl:: Private:: SummaryComponent sc ) {
Original file line number Diff line number Diff line change @@ -709,6 +709,9 @@ module Make<
709709 this = TConsSummaryComponentStack ( result , _)
710710 }
711711
712+ /** Gets the head of this stack if it is a singleton. */
713+ SummaryComponent headOfSingleton ( ) { this = TSingletonSummaryComponentStack ( result ) }
714+
712715 /** Gets the tail of this stack, if any. */
713716 SummaryComponentStack tail ( ) { this = TConsSummaryComponentStack ( _, result ) }
714717
You can’t perform that action at this time.
0 commit comments