@@ -114,6 +114,31 @@ module ModifiedFieldAccessToTimeConversionConfig implements InputSig {
114114module ModifiedFieldAccessToTimeConversion =
115115 ControlFlowReachability< ModifiedFieldAccessToTimeConversionConfig > ;
116116
117+ module SafeTimeGatheringFunctionCallToTimeConversionFunctionCallConfig implements InputSig {
118+ predicate isSource ( ControlFlowNode n ) {
119+ n = any ( SafeTimeGatheringFunction stgf ) .getACallToThisFunction ( )
120+ }
121+
122+ predicate isSink ( ControlFlowNode fcall ) { ModifiedFieldAccessToTimeConversion:: isSink ( fcall ) }
123+ }
124+
125+ module SafeTimeGatheringFunctionCallToTimeConversionFunctionCall =
126+ ControlFlowReachability< SafeTimeGatheringFunctionCallToTimeConversionFunctionCallConfig > ;
127+
128+ module SafeTimeGatheringFunctionCallToModifiedFieldAccessConfig implements InputSig {
129+ predicate isSource ( ControlFlowNode n ) {
130+ n = any ( SafeTimeGatheringFunction stgf ) .getACallToThisFunction ( ) and
131+ SafeTimeGatheringFunctionCallToTimeConversionFunctionCall:: isSource ( n )
132+ }
133+
134+ predicate isSink ( ControlFlowNode modifiedVarAccess ) {
135+ ModifiedFieldAccessToTimeConversion:: flowsTo ( modifiedVarAccess , _)
136+ }
137+ }
138+
139+ module SafeTimeGatheringFunctionCallToModifiedFieldAccess =
140+ ControlFlowReachability< SafeTimeGatheringFunctionCallToModifiedFieldAccessConfig > ;
141+
117142from FunctionCall fcall , TimeConversionFunction trf , Variable var
118143where
119144 isUnpackedTimeTypeVar ( var , fcall , trf ) and
@@ -125,13 +150,10 @@ where
125150 not (
126151 // Remove any instance where the predecessor is a SafeTimeGatheringFunction and no change to the data happened in between
127152 exists ( FunctionCall pred |
128- pred = fcall .getAPredecessor * ( ) and
129- exists ( SafeTimeGatheringFunction stgf | pred = stgf .getACallToThisFunction ( ) ) and
130- not exists ( DateStructModifiedFieldAccess dsmfa , VariableAccess modifiedVarAccess |
131- modifiedVarAccess = var .getAnAccess ( ) and
132- modifiedVarAccess = dsmfa .getQualifier ( ) and
133- modifiedVarAccess = fcall .getAPredecessor * ( ) and
134- modifiedVarAccess = pred .getASuccessor * ( )
153+ SafeTimeGatheringFunctionCallToTimeConversionFunctionCall:: flowsTo ( pred , fcall ) and
154+ not exists ( VariableAccess modifiedVarAccess |
155+ ModifiedFieldAccessToTimeConversion:: flowsTo ( modifiedVarAccess , fcall ) and
156+ SafeTimeGatheringFunctionCallToModifiedFieldAccess:: flowsTo ( pred , modifiedVarAccess )
135157 )
136158 )
137159 or
0 commit comments