File tree Expand file tree Collapse file tree 8 files changed +48
-80
lines changed
cpp/ql/lib/semmle/code/cpp
csharp/ql/lib/semmle/code/csharp/dataflow/internal
go/ql/lib/semmle/go/dataflow/internal
java/ql/lib/semmle/code/java/dataflow/internal
python/ql/lib/semmle/python/dataflow/new/internal
ruby/ql/lib/codeql/ruby/dataflow/internal
swift/ql/lib/codeql/swift/dataflow/internal Expand file tree Collapse file tree 8 files changed +48
-80
lines changed Original file line number Diff line number Diff line change @@ -418,6 +418,10 @@ module Impl<FullStateConfigSig Config> {
418
418
)
419
419
}
420
420
421
+ private predicate sourceCallCtx ( CallContext cc ) {
422
+ if hasSourceCallCtx ( ) then cc instanceof CallContextSomeCall else cc instanceof CallContextAny
423
+ }
424
+
421
425
private predicate hasSinkCallCtx ( ) {
422
426
exists ( FlowFeature feature | feature = Config:: getAFeature ( ) |
423
427
feature instanceof FeatureHasSinkCallContext or
@@ -2804,11 +2808,7 @@ module Impl<FullStateConfigSig Config> {
2804
2808
// A PathNode is introduced by a source ...
2805
2809
Stage5:: revFlow ( node , state ) and
2806
2810
sourceNode ( node , state ) and
2807
- (
2808
- if hasSourceCallCtx ( )
2809
- then cc instanceof CallContextSomeCall
2810
- else cc instanceof CallContextAny
2811
- ) and
2811
+ sourceCallCtx ( cc ) and
2812
2812
sc instanceof SummaryCtxNone and
2813
2813
ap = TAccessPathNil ( node .getDataFlowType ( ) )
2814
2814
or
@@ -3214,11 +3214,7 @@ module Impl<FullStateConfigSig Config> {
3214
3214
3215
3215
override predicate isSource ( ) {
3216
3216
sourceNode ( node , state ) and
3217
- (
3218
- if hasSourceCallCtx ( )
3219
- then cc instanceof CallContextSomeCall
3220
- else cc instanceof CallContextAny
3221
- ) and
3217
+ sourceCallCtx ( cc ) and
3222
3218
sc instanceof SummaryCtxNone and
3223
3219
ap = TAccessPathNil ( node .getDataFlowType ( ) )
3224
3220
}
Original file line number Diff line number Diff line change @@ -418,6 +418,10 @@ module Impl<FullStateConfigSig Config> {
418
418
)
419
419
}
420
420
421
+ private predicate sourceCallCtx ( CallContext cc ) {
422
+ if hasSourceCallCtx ( ) then cc instanceof CallContextSomeCall else cc instanceof CallContextAny
423
+ }
424
+
421
425
private predicate hasSinkCallCtx ( ) {
422
426
exists ( FlowFeature feature | feature = Config:: getAFeature ( ) |
423
427
feature instanceof FeatureHasSinkCallContext or
@@ -2804,11 +2808,7 @@ module Impl<FullStateConfigSig Config> {
2804
2808
// A PathNode is introduced by a source ...
2805
2809
Stage5:: revFlow ( node , state ) and
2806
2810
sourceNode ( node , state ) and
2807
- (
2808
- if hasSourceCallCtx ( )
2809
- then cc instanceof CallContextSomeCall
2810
- else cc instanceof CallContextAny
2811
- ) and
2811
+ sourceCallCtx ( cc ) and
2812
2812
sc instanceof SummaryCtxNone and
2813
2813
ap = TAccessPathNil ( node .getDataFlowType ( ) )
2814
2814
or
@@ -3214,11 +3214,7 @@ module Impl<FullStateConfigSig Config> {
3214
3214
3215
3215
override predicate isSource ( ) {
3216
3216
sourceNode ( node , state ) and
3217
- (
3218
- if hasSourceCallCtx ( )
3219
- then cc instanceof CallContextSomeCall
3220
- else cc instanceof CallContextAny
3221
- ) and
3217
+ sourceCallCtx ( cc ) and
3222
3218
sc instanceof SummaryCtxNone and
3223
3219
ap = TAccessPathNil ( node .getDataFlowType ( ) )
3224
3220
}
Original file line number Diff line number Diff line change @@ -418,6 +418,10 @@ module Impl<FullStateConfigSig Config> {
418
418
)
419
419
}
420
420
421
+ private predicate sourceCallCtx ( CallContext cc ) {
422
+ if hasSourceCallCtx ( ) then cc instanceof CallContextSomeCall else cc instanceof CallContextAny
423
+ }
424
+
421
425
private predicate hasSinkCallCtx ( ) {
422
426
exists ( FlowFeature feature | feature = Config:: getAFeature ( ) |
423
427
feature instanceof FeatureHasSinkCallContext or
@@ -2804,11 +2808,7 @@ module Impl<FullStateConfigSig Config> {
2804
2808
// A PathNode is introduced by a source ...
2805
2809
Stage5:: revFlow ( node , state ) and
2806
2810
sourceNode ( node , state ) and
2807
- (
2808
- if hasSourceCallCtx ( )
2809
- then cc instanceof CallContextSomeCall
2810
- else cc instanceof CallContextAny
2811
- ) and
2811
+ sourceCallCtx ( cc ) and
2812
2812
sc instanceof SummaryCtxNone and
2813
2813
ap = TAccessPathNil ( node .getDataFlowType ( ) )
2814
2814
or
@@ -3214,11 +3214,7 @@ module Impl<FullStateConfigSig Config> {
3214
3214
3215
3215
override predicate isSource ( ) {
3216
3216
sourceNode ( node , state ) and
3217
- (
3218
- if hasSourceCallCtx ( )
3219
- then cc instanceof CallContextSomeCall
3220
- else cc instanceof CallContextAny
3221
- ) and
3217
+ sourceCallCtx ( cc ) and
3222
3218
sc instanceof SummaryCtxNone and
3223
3219
ap = TAccessPathNil ( node .getDataFlowType ( ) )
3224
3220
}
Original file line number Diff line number Diff line change @@ -418,6 +418,10 @@ module Impl<FullStateConfigSig Config> {
418
418
)
419
419
}
420
420
421
+ private predicate sourceCallCtx ( CallContext cc ) {
422
+ if hasSourceCallCtx ( ) then cc instanceof CallContextSomeCall else cc instanceof CallContextAny
423
+ }
424
+
421
425
private predicate hasSinkCallCtx ( ) {
422
426
exists ( FlowFeature feature | feature = Config:: getAFeature ( ) |
423
427
feature instanceof FeatureHasSinkCallContext or
@@ -2804,11 +2808,7 @@ module Impl<FullStateConfigSig Config> {
2804
2808
// A PathNode is introduced by a source ...
2805
2809
Stage5:: revFlow ( node , state ) and
2806
2810
sourceNode ( node , state ) and
2807
- (
2808
- if hasSourceCallCtx ( )
2809
- then cc instanceof CallContextSomeCall
2810
- else cc instanceof CallContextAny
2811
- ) and
2811
+ sourceCallCtx ( cc ) and
2812
2812
sc instanceof SummaryCtxNone and
2813
2813
ap = TAccessPathNil ( node .getDataFlowType ( ) )
2814
2814
or
@@ -3214,11 +3214,7 @@ module Impl<FullStateConfigSig Config> {
3214
3214
3215
3215
override predicate isSource ( ) {
3216
3216
sourceNode ( node , state ) and
3217
- (
3218
- if hasSourceCallCtx ( )
3219
- then cc instanceof CallContextSomeCall
3220
- else cc instanceof CallContextAny
3221
- ) and
3217
+ sourceCallCtx ( cc ) and
3222
3218
sc instanceof SummaryCtxNone and
3223
3219
ap = TAccessPathNil ( node .getDataFlowType ( ) )
3224
3220
}
Original file line number Diff line number Diff line change @@ -418,6 +418,10 @@ module Impl<FullStateConfigSig Config> {
418
418
)
419
419
}
420
420
421
+ private predicate sourceCallCtx ( CallContext cc ) {
422
+ if hasSourceCallCtx ( ) then cc instanceof CallContextSomeCall else cc instanceof CallContextAny
423
+ }
424
+
421
425
private predicate hasSinkCallCtx ( ) {
422
426
exists ( FlowFeature feature | feature = Config:: getAFeature ( ) |
423
427
feature instanceof FeatureHasSinkCallContext or
@@ -2804,11 +2808,7 @@ module Impl<FullStateConfigSig Config> {
2804
2808
// A PathNode is introduced by a source ...
2805
2809
Stage5:: revFlow ( node , state ) and
2806
2810
sourceNode ( node , state ) and
2807
- (
2808
- if hasSourceCallCtx ( )
2809
- then cc instanceof CallContextSomeCall
2810
- else cc instanceof CallContextAny
2811
- ) and
2811
+ sourceCallCtx ( cc ) and
2812
2812
sc instanceof SummaryCtxNone and
2813
2813
ap = TAccessPathNil ( node .getDataFlowType ( ) )
2814
2814
or
@@ -3214,11 +3214,7 @@ module Impl<FullStateConfigSig Config> {
3214
3214
3215
3215
override predicate isSource ( ) {
3216
3216
sourceNode ( node , state ) and
3217
- (
3218
- if hasSourceCallCtx ( )
3219
- then cc instanceof CallContextSomeCall
3220
- else cc instanceof CallContextAny
3221
- ) and
3217
+ sourceCallCtx ( cc ) and
3222
3218
sc instanceof SummaryCtxNone and
3223
3219
ap = TAccessPathNil ( node .getDataFlowType ( ) )
3224
3220
}
Original file line number Diff line number Diff line change @@ -418,6 +418,10 @@ module Impl<FullStateConfigSig Config> {
418
418
)
419
419
}
420
420
421
+ private predicate sourceCallCtx ( CallContext cc ) {
422
+ if hasSourceCallCtx ( ) then cc instanceof CallContextSomeCall else cc instanceof CallContextAny
423
+ }
424
+
421
425
private predicate hasSinkCallCtx ( ) {
422
426
exists ( FlowFeature feature | feature = Config:: getAFeature ( ) |
423
427
feature instanceof FeatureHasSinkCallContext or
@@ -2804,11 +2808,7 @@ module Impl<FullStateConfigSig Config> {
2804
2808
// A PathNode is introduced by a source ...
2805
2809
Stage5:: revFlow ( node , state ) and
2806
2810
sourceNode ( node , state ) and
2807
- (
2808
- if hasSourceCallCtx ( )
2809
- then cc instanceof CallContextSomeCall
2810
- else cc instanceof CallContextAny
2811
- ) and
2811
+ sourceCallCtx ( cc ) and
2812
2812
sc instanceof SummaryCtxNone and
2813
2813
ap = TAccessPathNil ( node .getDataFlowType ( ) )
2814
2814
or
@@ -3214,11 +3214,7 @@ module Impl<FullStateConfigSig Config> {
3214
3214
3215
3215
override predicate isSource ( ) {
3216
3216
sourceNode ( node , state ) and
3217
- (
3218
- if hasSourceCallCtx ( )
3219
- then cc instanceof CallContextSomeCall
3220
- else cc instanceof CallContextAny
3221
- ) and
3217
+ sourceCallCtx ( cc ) and
3222
3218
sc instanceof SummaryCtxNone and
3223
3219
ap = TAccessPathNil ( node .getDataFlowType ( ) )
3224
3220
}
Original file line number Diff line number Diff line change @@ -418,6 +418,10 @@ module Impl<FullStateConfigSig Config> {
418
418
)
419
419
}
420
420
421
+ private predicate sourceCallCtx ( CallContext cc ) {
422
+ if hasSourceCallCtx ( ) then cc instanceof CallContextSomeCall else cc instanceof CallContextAny
423
+ }
424
+
421
425
private predicate hasSinkCallCtx ( ) {
422
426
exists ( FlowFeature feature | feature = Config:: getAFeature ( ) |
423
427
feature instanceof FeatureHasSinkCallContext or
@@ -2804,11 +2808,7 @@ module Impl<FullStateConfigSig Config> {
2804
2808
// A PathNode is introduced by a source ...
2805
2809
Stage5:: revFlow ( node , state ) and
2806
2810
sourceNode ( node , state ) and
2807
- (
2808
- if hasSourceCallCtx ( )
2809
- then cc instanceof CallContextSomeCall
2810
- else cc instanceof CallContextAny
2811
- ) and
2811
+ sourceCallCtx ( cc ) and
2812
2812
sc instanceof SummaryCtxNone and
2813
2813
ap = TAccessPathNil ( node .getDataFlowType ( ) )
2814
2814
or
@@ -3214,11 +3214,7 @@ module Impl<FullStateConfigSig Config> {
3214
3214
3215
3215
override predicate isSource ( ) {
3216
3216
sourceNode ( node , state ) and
3217
- (
3218
- if hasSourceCallCtx ( )
3219
- then cc instanceof CallContextSomeCall
3220
- else cc instanceof CallContextAny
3221
- ) and
3217
+ sourceCallCtx ( cc ) and
3222
3218
sc instanceof SummaryCtxNone and
3223
3219
ap = TAccessPathNil ( node .getDataFlowType ( ) )
3224
3220
}
Original file line number Diff line number Diff line change @@ -418,6 +418,10 @@ module Impl<FullStateConfigSig Config> {
418
418
)
419
419
}
420
420
421
+ private predicate sourceCallCtx ( CallContext cc ) {
422
+ if hasSourceCallCtx ( ) then cc instanceof CallContextSomeCall else cc instanceof CallContextAny
423
+ }
424
+
421
425
private predicate hasSinkCallCtx ( ) {
422
426
exists ( FlowFeature feature | feature = Config:: getAFeature ( ) |
423
427
feature instanceof FeatureHasSinkCallContext or
@@ -2804,11 +2808,7 @@ module Impl<FullStateConfigSig Config> {
2804
2808
// A PathNode is introduced by a source ...
2805
2809
Stage5:: revFlow ( node , state ) and
2806
2810
sourceNode ( node , state ) and
2807
- (
2808
- if hasSourceCallCtx ( )
2809
- then cc instanceof CallContextSomeCall
2810
- else cc instanceof CallContextAny
2811
- ) and
2811
+ sourceCallCtx ( cc ) and
2812
2812
sc instanceof SummaryCtxNone and
2813
2813
ap = TAccessPathNil ( node .getDataFlowType ( ) )
2814
2814
or
@@ -3214,11 +3214,7 @@ module Impl<FullStateConfigSig Config> {
3214
3214
3215
3215
override predicate isSource ( ) {
3216
3216
sourceNode ( node , state ) and
3217
- (
3218
- if hasSourceCallCtx ( )
3219
- then cc instanceof CallContextSomeCall
3220
- else cc instanceof CallContextAny
3221
- ) and
3217
+ sourceCallCtx ( cc ) and
3222
3218
sc instanceof SummaryCtxNone and
3223
3219
ap = TAccessPathNil ( node .getDataFlowType ( ) )
3224
3220
}
You can’t perform that action at this time.
0 commit comments