@@ -343,15 +343,19 @@ private predicate hasStoreSummary(
343
343
SummarizedCallable callable , DataFlow:: ContentSet contents , SummaryComponentStack input ,
344
344
SummaryComponentStack output
345
345
) {
346
- callable .propagatesFlow ( input , push ( SummaryComponent:: content ( contents ) , output ) , true )
346
+ callable .propagatesFlow ( input , push ( SummaryComponent:: content ( contents ) , output ) , true ) and
347
+ not isNonLocal ( input .head ( ) ) and
348
+ not isNonLocal ( output .head ( ) )
347
349
}
348
350
349
351
pragma [ nomagic]
350
352
private predicate hasLoadSummary (
351
353
SummarizedCallable callable , DataFlow:: ContentSet contents , SummaryComponentStack input ,
352
354
SummaryComponentStack output
353
355
) {
354
- callable .propagatesFlow ( push ( SummaryComponent:: content ( contents ) , input ) , output , true )
356
+ callable .propagatesFlow ( push ( SummaryComponent:: content ( contents ) , input ) , output , true ) and
357
+ not isNonLocal ( input .head ( ) ) and
358
+ not isNonLocal ( output .head ( ) )
355
359
}
356
360
357
361
pragma [ nomagic]
@@ -362,6 +366,8 @@ private predicate hasLoadStoreSummary(
362
366
callable
363
367
.propagatesFlow ( push ( SummaryComponent:: content ( loadContents ) , input ) ,
364
368
push ( SummaryComponent:: content ( storeContents ) , output ) , true ) and
369
+ not isNonLocal ( input .head ( ) ) and
370
+ not isNonLocal ( output .head ( ) ) and
365
371
callable != "Hash.[]" // Special-cased due to having a huge number of summaries
366
372
}
367
373
@@ -397,6 +403,8 @@ private predicate hasWithoutContentSummary(
397
403
exists ( DataFlow:: ContentSet content |
398
404
callable .propagatesFlow ( push ( SummaryComponent:: withoutContent ( content ) , input ) , output , true ) and
399
405
filter = getFilterFromWithoutContentStep ( content ) and
406
+ not isNonLocal ( input .head ( ) ) and
407
+ not isNonLocal ( output .head ( ) ) and
400
408
input != output
401
409
)
402
410
}
@@ -433,10 +441,18 @@ private predicate hasWithContentSummary(
433
441
exists ( DataFlow:: ContentSet content |
434
442
callable .propagatesFlow ( push ( SummaryComponent:: withContent ( content ) , input ) , output , true ) and
435
443
filter = getFilterFromWithContentStep ( content ) and
444
+ not isNonLocal ( input .head ( ) ) and
445
+ not isNonLocal ( output .head ( ) ) and
436
446
input != output
437
447
)
438
448
}
439
449
450
+ /**
451
+ * Holds if the given component can't be evaluated by `evaluateSummaryComponentStackLocal`.
452
+ */
453
+ pragma [ nomagic]
454
+ predicate isNonLocal ( SummaryComponent component ) { component = SC:: content ( _) }
455
+
440
456
/**
441
457
* Gets a data flow node corresponding an argument or return value of `call`,
442
458
* as specified by `component`.
0 commit comments