@@ -1439,23 +1439,15 @@ module MakeImplCommon<LocationSig Location, InputSig<Location> Lang> {
1439
1439
CachedCallContextSensitivity:: CcNoCall ctx1 , CachedCallContextSensitivity:: CcNoCall ctx2
1440
1440
|
1441
1441
model = mergeModels ( model1 , model2 ) and
1442
- (
1443
- // call may restrict the set of call sites that can be returned to
1444
- ctx2 .( CachedCallContextSensitivity:: CcReturn ) .isReturn ( callable , call )
1445
- or
1446
- // call does not restrict the set of call sites that can be returned to
1447
- not exists ( CachedCallContextSensitivity:: CcReturn ret | ret .isReturn ( callable , call ) ) and
1448
- CachedCallContextSensitivity:: viableImplNotCallContextReducedReverse ( ctx2 )
1449
- ) and
1450
1442
ctx = mergeContexts ( ctx1 , ctx2 )
1451
1443
|
1452
1444
// flow through: no prior read
1453
1445
parameterValueFlowArg ( p , arg , mustBeNone , model1 , ctx1 ) and
1454
- argumentValueFlowsThrough ( call , callable , arg , read , node , model2 )
1446
+ argumentValueFlowsThrough ( call , callable , arg , read , node , model2 , ctx2 )
1455
1447
or
1456
1448
// flow through: no read inside method
1457
1449
parameterValueFlowArg ( p , arg , read , model1 , ctx1 ) and
1458
- argumentValueFlowsThrough ( call , callable , arg , mustBeNone , node , model2 )
1450
+ argumentValueFlowsThrough ( call , callable , arg , mustBeNone , node , model2 , ctx2 )
1459
1451
)
1460
1452
}
1461
1453
@@ -1471,26 +1463,28 @@ module MakeImplCommon<LocationSig Location, InputSig<Location> Lang> {
1471
1463
pragma [ nomagic]
1472
1464
private predicate argumentValueFlowsThrough0 (
1473
1465
DataFlowCall call , DataFlowCallable callable , ArgNode arg , ReturnKind kind ,
1474
- ReadStepTypesOption read , string model
1466
+ ReadStepTypesOption read , string model , CachedCallContextSensitivity :: CcNoCall outerCtx
1475
1467
) {
1476
- exists ( ParamNode param , CachedCallContextSensitivity:: CcNoCall ctx |
1468
+ exists ( ParamNode param , CachedCallContextSensitivity:: CcNoCall innerCtx |
1477
1469
viableParamArg ( call , param , arg ) and
1478
- parameterValueFlowReturn ( param , kind , read , model , ctx ) and
1479
- callable = nodeGetEnclosingCallable ( param )
1470
+ parameterValueFlowReturn ( param , kind , read , model , innerCtx ) and
1471
+ callable = nodeGetEnclosingCallable ( param ) and
1472
+ outerCtx = CachedCallContextSensitivity:: getCallContextReturn ( callable , call )
1480
1473
|
1481
- CachedCallContextSensitivity:: viableImplNotCallContextReducedReverse ( ctx )
1474
+ CachedCallContextSensitivity:: viableImplNotCallContextReducedReverse ( innerCtx )
1482
1475
or
1483
- call = CachedCallContextSensitivity:: viableImplCallContextReducedReverse ( callable , ctx )
1476
+ call =
1477
+ CachedCallContextSensitivity:: viableImplCallContextReducedReverse ( callable , innerCtx )
1484
1478
)
1485
1479
}
1486
1480
1487
1481
pragma [ nomagic]
1488
1482
private predicate argumentValueFlowsThrough (
1489
1483
DataFlowCall call , DataFlowCallable callable , ArgNode arg , ReadStepTypesOption read ,
1490
- Node out , string model
1484
+ Node out , string model , CachedCallContextSensitivity :: CcNoCall ctx
1491
1485
) {
1492
1486
exists ( ReturnKind kind |
1493
- argumentValueFlowsThrough0 ( call , callable , arg , kind , read , model ) and
1487
+ argumentValueFlowsThrough0 ( call , callable , arg , kind , read , model , ctx ) and
1494
1488
out = getAnOutNode ( call , kind )
1495
1489
|
1496
1490
// normal flow through
@@ -1515,7 +1509,7 @@ module MakeImplCommon<LocationSig Location, InputSig<Location> Lang> {
1515
1509
predicate argumentValueFlowsThrough (
1516
1510
ArgNode arg , ReadStepTypesOption read , Node out , string model
1517
1511
) {
1518
- argumentValueFlowsThrough ( _, _, arg , read , out , model )
1512
+ argumentValueFlowsThrough ( _, _, arg , read , out , model , _ )
1519
1513
}
1520
1514
1521
1515
/**
0 commit comments