@@ -325,9 +325,18 @@ private predicate hasStoreSummary(
325325 SummarizedCallable callable , DataFlow:: ContentSet contents , SummaryComponentStack input ,
326326 SummaryComponentStack output
327327) {
328- callable .propagatesFlow ( input , push ( SummaryComponent:: content ( contents ) , output ) , true ) and
329328 not isNonLocal ( input .head ( ) ) and
330- not isNonLocal ( output .head ( ) )
329+ not isNonLocal ( output .head ( ) ) and
330+ (
331+ callable .propagatesFlow ( input , push ( SummaryComponent:: content ( contents ) , output ) , true )
332+ or
333+ // Allow the input to start with an arbitrary WithoutContent[X].
334+ // Since type-tracking only tracks one content deep, and we're about to store into another content,
335+ // we're already preventing the input from being in a content.
336+ callable
337+ .propagatesFlow ( push ( SummaryComponent:: withoutContent ( _) , input ) ,
338+ push ( SummaryComponent:: content ( contents ) , output ) , true )
339+ )
331340}
332341
333342pragma [ nomagic]
@@ -460,6 +469,9 @@ private predicate dependsOnSummaryComponentStack(
460469 callable .propagatesFlow ( stack , _, true )
461470 or
462471 callable .propagatesFlow ( _, stack , true )
472+ or
473+ // include store summaries as they may skip an initial step at the input
474+ hasStoreSummary ( callable , _, stack , _)
463475 )
464476 or
465477 dependsOnSummaryComponentStackCons ( callable , _, stack )
0 commit comments