@@ -3903,46 +3903,35 @@ module Impl<FullStateConfigSig Config> {
3903
3903
private int distSink ( DataFlowCallable c ) { result = distSinkExt ( TCallable ( c ) ) - 1 }
3904
3904
3905
3905
private newtype TPartialAccessPath =
3906
- TPartialNil ( DataFlowType t ) or
3907
- TPartialCons ( TypedContent tc , int len ) { len in [ 1 .. accessPathLimit ( ) ] }
3906
+ TPartialNil ( ) or
3907
+ TPartialCons ( Content c , int len ) { len in [ 1 .. accessPathLimit ( ) ] }
3908
3908
3909
3909
/**
3910
- * Conceptually a list of `TypedContent`s followed by a `Type`, but only the first
3911
- * element of the list and its length are tracked. If data flows from a source to
3912
- * a given node with a given `AccessPath`, this indicates the sequence of
3913
- * dereference operations needed to get from the value in the node to the
3914
- * tracked object. The final type indicates the type of the tracked object.
3910
+ * Conceptually a list of `Content`s, but only the first
3911
+ * element of the list and its length are tracked.
3915
3912
*/
3916
3913
private class PartialAccessPath extends TPartialAccessPath {
3917
3914
abstract string toString ( ) ;
3918
3915
3919
- TypedContent getHead ( ) { this = TPartialCons ( result , _) }
3916
+ Content getHead ( ) { this = TPartialCons ( result , _) }
3920
3917
3921
3918
int len ( ) {
3922
- this = TPartialNil ( _ ) and result = 0
3919
+ this = TPartialNil ( ) and result = 0
3923
3920
or
3924
3921
this = TPartialCons ( _, result )
3925
3922
}
3926
-
3927
- DataFlowType getType ( ) {
3928
- this = TPartialNil ( result )
3929
- or
3930
- exists ( TypedContent head | this = TPartialCons ( head , _) | result = head .getContainerType ( ) )
3931
- }
3932
3923
}
3933
3924
3934
3925
private class PartialAccessPathNil extends PartialAccessPath , TPartialNil {
3935
- override string toString ( ) {
3936
- exists ( DataFlowType t | this = TPartialNil ( t ) | result = concat ( ": " + ppReprType ( t ) ) )
3937
- }
3926
+ override string toString ( ) { result = "" }
3938
3927
}
3939
3928
3940
3929
private class PartialAccessPathCons extends PartialAccessPath , TPartialCons {
3941
3930
override string toString ( ) {
3942
- exists ( TypedContent tc , int len | this = TPartialCons ( tc , len ) |
3931
+ exists ( Content c , int len | this = TPartialCons ( c , len ) |
3943
3932
if len = 1
3944
- then result = "[" + tc .toString ( ) + "]"
3945
- else result = "[" + tc .toString ( ) + ", ... (" + len .toString ( ) + ")]"
3933
+ then result = "[" + c .toString ( ) + "]"
3934
+ else result = "[" + c .toString ( ) + ", ... (" + len .toString ( ) + ")]"
3946
3935
)
3947
3936
}
3948
3937
}
@@ -4030,7 +4019,7 @@ module Impl<FullStateConfigSig Config> {
4030
4019
sc3 = TSummaryCtx3None ( ) and
4031
4020
sc4 = TSummaryCtx4None ( ) and
4032
4021
t = node .getDataFlowType ( ) and
4033
- ap = TPartialNil ( node . getDataFlowType ( ) ) and
4022
+ ap = TPartialNil ( ) and
4034
4023
exists ( explorationLimit ( ) )
4035
4024
or
4036
4025
partialPathNodeMk0 ( node , state , cc , sc1 , sc2 , sc3 , sc4 , t , ap ) and
@@ -4066,10 +4055,10 @@ module Impl<FullStateConfigSig Config> {
4066
4055
partialPathStep ( _, node , state , cc , sc1 , sc2 , sc3 , sc4 , t , ap ) and
4067
4056
not fullBarrier ( node ) and
4068
4057
not stateBarrier ( node , state ) and
4069
- not clearsContentEx ( node , ap .getHead ( ) . getContent ( ) ) and
4058
+ not clearsContentEx ( node , ap .getHead ( ) ) and
4070
4059
(
4071
4060
notExpectsContent ( node ) or
4072
- expectsContentEx ( node , ap .getHead ( ) . getContent ( ) )
4061
+ expectsContentEx ( node , ap .getHead ( ) )
4073
4062
) and
4074
4063
if node .asNode ( ) instanceof CastingNode
4075
4064
then compatibleTypes ( node .getDataFlowType ( ) , t )
@@ -4274,7 +4263,7 @@ module Impl<FullStateConfigSig Config> {
4274
4263
sc4 = mid .getSummaryCtx4 ( ) and
4275
4264
mid .getAp ( ) instanceof PartialAccessPathNil and
4276
4265
t = node .getDataFlowType ( ) and
4277
- ap = TPartialNil ( node . getDataFlowType ( ) )
4266
+ ap = TPartialNil ( )
4278
4267
or
4279
4268
additionalLocalStateStep ( mid .getNodeEx ( ) , mid .getState ( ) , node , state ) and
4280
4269
cc = mid .getCallContext ( ) and
@@ -4284,7 +4273,7 @@ module Impl<FullStateConfigSig Config> {
4284
4273
sc4 = mid .getSummaryCtx4 ( ) and
4285
4274
mid .getAp ( ) instanceof PartialAccessPathNil and
4286
4275
t = node .getDataFlowType ( ) and
4287
- ap = TPartialNil ( node . getDataFlowType ( ) )
4276
+ ap = TPartialNil ( )
4288
4277
)
4289
4278
or
4290
4279
jumpStepEx ( mid .getNodeEx ( ) , node ) and
@@ -4306,7 +4295,7 @@ module Impl<FullStateConfigSig Config> {
4306
4295
sc4 = TSummaryCtx4None ( ) and
4307
4296
mid .getAp ( ) instanceof PartialAccessPathNil and
4308
4297
t = node .getDataFlowType ( ) and
4309
- ap = TPartialNil ( node . getDataFlowType ( ) )
4298
+ ap = TPartialNil ( )
4310
4299
or
4311
4300
additionalJumpStateStep ( mid .getNodeEx ( ) , mid .getState ( ) , node , state ) and
4312
4301
cc instanceof CallContextAny and
@@ -4316,7 +4305,7 @@ module Impl<FullStateConfigSig Config> {
4316
4305
sc4 = TSummaryCtx4None ( ) and
4317
4306
mid .getAp ( ) instanceof PartialAccessPathNil and
4318
4307
t = node .getDataFlowType ( ) and
4319
- ap = TPartialNil ( node . getDataFlowType ( ) )
4308
+ ap = TPartialNil ( )
4320
4309
or
4321
4310
partialPathStoreStep ( mid , _, _, _, node , t , ap ) and
4322
4311
state = mid .getState ( ) and
@@ -4359,12 +4348,12 @@ module Impl<FullStateConfigSig Config> {
4359
4348
PartialPathNodeFwd mid , DataFlowType t1 , PartialAccessPath ap1 , Content c , NodeEx node ,
4360
4349
DataFlowType t2 , PartialAccessPath ap2
4361
4350
) {
4362
- exists ( NodeEx midNode , DataFlowType contentType , TypedContent tc |
4351
+ exists ( NodeEx midNode , DataFlowType contentType |
4363
4352
midNode = mid .getNodeEx ( ) and
4364
4353
t1 = mid .getType ( ) and
4365
4354
ap1 = mid .getAp ( ) and
4366
- storeEx ( midNode , tc , c , node , contentType , t2 ) and
4367
- ap2 .getHead ( ) = tc and
4355
+ storeEx ( midNode , _ , c , node , contentType , t2 ) and
4356
+ ap2 .getHead ( ) = c and
4368
4357
ap2 .len ( ) = unbindInt ( ap1 .len ( ) + 1 ) and
4369
4358
compatibleTypes ( t1 , contentType )
4370
4359
)
@@ -4384,7 +4373,7 @@ module Impl<FullStateConfigSig Config> {
4384
4373
t = mid .getType ( ) and
4385
4374
ap = mid .getAp ( ) and
4386
4375
read ( midNode , c , node ) and
4387
- ap .getHead ( ) . getContent ( ) = c and
4376
+ ap .getHead ( ) = c and
4388
4377
cc = mid .getCallContext ( )
4389
4378
)
4390
4379
}
0 commit comments