@@ -1307,33 +1307,39 @@ private predicate localFlowExit(Node node, Configuration config) {
1307
1307
*/
1308
1308
pragma [ nomagic]
1309
1309
private predicate localFlowStepPlus (
1310
- Node node1 , Node node2 , boolean preservesValue , Configuration config , LocalCallContext cc
1310
+ Node node1 , Node node2 , boolean preservesValue , DataFlowType t , Configuration config ,
1311
+ LocalCallContext cc
1311
1312
) {
1312
1313
not isUnreachableInCall ( node2 , cc .( LocalCallContextSpecificCall ) .getCall ( ) ) and
1313
1314
(
1314
1315
localFlowEntry ( node1 , config ) and
1315
1316
(
1316
- localFlowStep ( node1 , node2 , config ) and preservesValue = true
1317
+ localFlowStep ( node1 , node2 , config ) and
1318
+ preservesValue = true and
1319
+ t = getErasedNodeTypeBound ( node1 )
1317
1320
or
1318
- additionalLocalFlowStep ( node1 , node2 , config ) and preservesValue = false
1321
+ additionalLocalFlowStep ( node1 , node2 , config ) and
1322
+ preservesValue = false and
1323
+ t = getErasedNodeTypeBound ( node2 )
1319
1324
) and
1320
1325
node1 != node2 and
1321
1326
cc .relevantFor ( node1 .getEnclosingCallable ( ) ) and
1322
1327
not isUnreachableInCall ( node1 , cc .( LocalCallContextSpecificCall ) .getCall ( ) ) and
1323
1328
nodeCand ( TNormalNode ( node2 ) , unbind ( config ) )
1324
1329
or
1325
1330
exists ( Node mid |
1326
- localFlowStepPlus ( node1 , mid , preservesValue , config , cc ) and
1331
+ localFlowStepPlus ( node1 , mid , preservesValue , t , config , cc ) and
1327
1332
localFlowStep ( mid , node2 , config ) and
1328
1333
not mid instanceof CastNode and
1329
1334
nodeCand ( TNormalNode ( node2 ) , unbind ( config ) )
1330
1335
)
1331
1336
or
1332
1337
exists ( Node mid |
1333
- localFlowStepPlus ( node1 , mid , _, config , cc ) and
1338
+ localFlowStepPlus ( node1 , mid , _, _ , config , cc ) and
1334
1339
additionalLocalFlowStep ( mid , node2 , config ) and
1335
1340
not mid instanceof CastNode and
1336
1341
preservesValue = false and
1342
+ t = getErasedNodeTypeBound ( node2 ) and
1337
1343
nodeCand ( TNormalNode ( node2 ) , unbind ( config ) )
1338
1344
)
1339
1345
)
@@ -1345,17 +1351,18 @@ private predicate localFlowStepPlus(
1345
1351
*/
1346
1352
pragma [ nomagic]
1347
1353
private predicate localFlowBigStep (
1348
- Node node1 , Node node2 , boolean preservesValue , Configuration config , LocalCallContext callContext
1354
+ Node node1 , Node node2 , boolean preservesValue , DataFlowType t , Configuration config ,
1355
+ LocalCallContext callContext
1349
1356
) {
1350
- localFlowStepPlus ( node1 , node2 , preservesValue , config , callContext ) and
1357
+ localFlowStepPlus ( node1 , node2 , preservesValue , t , config , callContext ) and
1351
1358
localFlowExit ( node2 , config )
1352
1359
}
1353
1360
1354
1361
pragma [ nomagic]
1355
1362
private predicate localFlowBigStepExt (
1356
- NodeExt node1 , NodeExt node2 , boolean preservesValue , Configuration config
1363
+ NodeExt node1 , NodeExt node2 , boolean preservesValue , AccessPathFrontNil apf , Configuration config
1357
1364
) {
1358
- localFlowBigStep ( node1 .getNode ( ) , node2 .getNode ( ) , preservesValue , config , _)
1365
+ localFlowBigStep ( node1 .getNode ( ) , node2 .getNode ( ) , preservesValue , apf . getType ( ) , config , _)
1359
1366
}
1360
1367
1361
1368
private newtype TAccessPathFront =
@@ -1406,8 +1413,6 @@ private class AccessPathFrontNilNode extends NormalNodeExt {
1406
1413
(
1407
1414
any ( Configuration c ) .isSource ( this .getNode ( ) )
1408
1415
or
1409
- localFlowBigStepExt ( _, this , false , _)
1410
- or
1411
1416
additionalJumpStepExt ( _, this , _)
1412
1417
)
1413
1418
}
@@ -1428,13 +1433,12 @@ private predicate flowCandFwd0(
1428
1433
(
1429
1434
exists ( NodeExt mid |
1430
1435
flowCandFwd ( mid , fromArg , apf , config ) and
1431
- localFlowBigStepExt ( mid , node , true , config )
1436
+ localFlowBigStepExt ( mid , node , true , _ , config )
1432
1437
)
1433
1438
or
1434
1439
exists ( NodeExt mid , AccessPathFrontNil nil |
1435
1440
flowCandFwd ( mid , fromArg , nil , config ) and
1436
- localFlowBigStepExt ( mid , node , false , config ) and
1437
- apf = node .( AccessPathFrontNilNode ) .getApf ( )
1441
+ localFlowBigStepExt ( mid , node , false , apf , config )
1438
1442
)
1439
1443
or
1440
1444
exists ( NodeExt mid |
@@ -1589,13 +1593,13 @@ private predicate flowCand0(
1589
1593
apf instanceof AccessPathFrontNil
1590
1594
or
1591
1595
exists ( NodeExt mid |
1592
- localFlowBigStepExt ( node , mid , true , config ) and
1596
+ localFlowBigStepExt ( node , mid , true , _ , config ) and
1593
1597
flowCand ( mid , toReturn , apf , config )
1594
1598
)
1595
1599
or
1596
1600
exists ( NodeExt mid , AccessPathFrontNil nil |
1597
1601
flowCandFwd ( node , _, apf , config ) and
1598
- localFlowBigStepExt ( node , mid , false , config ) and
1602
+ localFlowBigStepExt ( node , mid , false , _ , config ) and
1599
1603
flowCand ( mid , toReturn , nil , config ) and
1600
1604
apf instanceof AccessPathFrontNil
1601
1605
)
@@ -1845,13 +1849,12 @@ private predicate flowFwd0(
1845
1849
(
1846
1850
exists ( NodeExt mid |
1847
1851
flowFwd ( mid , fromArg , apf , ap , config ) and
1848
- localFlowBigStepExt ( mid , node , true , config )
1852
+ localFlowBigStepExt ( mid , node , true , _ , config )
1849
1853
)
1850
1854
or
1851
1855
exists ( NodeExt mid , AccessPathNil nil |
1852
1856
flowFwd ( mid , fromArg , _, nil , config ) and
1853
- localFlowBigStepExt ( mid , node , false , config ) and
1854
- ap = node .( AccessPathNilNode ) .getAp ( ) and
1857
+ localFlowBigStepExt ( mid , node , false , apf , config ) and
1855
1858
apf = ap .( AccessPathNil ) .getFront ( )
1856
1859
)
1857
1860
or
@@ -1982,13 +1985,13 @@ private predicate flow0(NodeExt node, boolean toReturn, AccessPath ap, Configura
1982
1985
ap instanceof AccessPathNil
1983
1986
or
1984
1987
exists ( NodeExt mid |
1985
- localFlowBigStepExt ( node , mid , true , config ) and
1988
+ localFlowBigStepExt ( node , mid , true , _ , config ) and
1986
1989
flow ( mid , toReturn , ap , config )
1987
1990
)
1988
1991
or
1989
1992
exists ( NodeExt mid , AccessPathNil nil |
1990
1993
flowFwd ( node , _, _, ap , config ) and
1991
- localFlowBigStepExt ( node , mid , false , config ) and
1994
+ localFlowBigStepExt ( node , mid , false , _ , config ) and
1992
1995
flow ( mid , toReturn , nil , config ) and
1993
1996
ap instanceof AccessPathNil
1994
1997
)
@@ -2357,12 +2360,11 @@ private predicate pathStep(PathNodeMid mid, Node node, CallContext cc, SummaryCt
2357
2360
pathIntoLocalStep ( mid , midnode , cc , enclosing , sc , ap0 , conf ) and
2358
2361
localCC = getLocalCallContext ( cc , enclosing )
2359
2362
|
2360
- localFlowBigStep ( midnode , node , true , conf , localCC ) and
2363
+ localFlowBigStep ( midnode , node , true , _ , conf , localCC ) and
2361
2364
ap = ap0
2362
2365
or
2363
- localFlowBigStep ( midnode , node , false , conf , localCC ) and
2364
- ap0 instanceof AccessPathNil and
2365
- ap = any ( AccessPathNilNode nil | nil .getNode ( ) = node ) .getAp ( )
2366
+ localFlowBigStep ( midnode , node , false , ap .( AccessPathNil ) .getType ( ) , conf , localCC ) and
2367
+ ap0 instanceof AccessPathNil
2366
2368
)
2367
2369
or
2368
2370
jumpStep ( mid .getNode ( ) , node , mid .getConfiguration ( ) ) and
@@ -2397,7 +2399,7 @@ private predicate pathIntoLocalStep(
2397
2399
midnode = mid .getNode ( ) and
2398
2400
cc = mid .getCallContext ( ) and
2399
2401
conf = mid .getConfiguration ( ) and
2400
- localFlowBigStep ( midnode , _, _, conf , _) and
2402
+ localFlowBigStep ( midnode , _, _, _ , conf , _) and
2401
2403
enclosing = midnode .getEnclosingCallable ( ) and
2402
2404
sc = mid .getSummaryCtx ( ) and
2403
2405
ap0 = mid .getAp ( )
0 commit comments