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> {
418418 )
419419 }
420420
421+ private predicate sourceCallCtx ( CallContext cc ) {
422+ if hasSourceCallCtx ( ) then cc instanceof CallContextSomeCall else cc instanceof CallContextAny
423+ }
424+
421425 private predicate hasSinkCallCtx ( ) {
422426 exists ( FlowFeature feature | feature = Config:: getAFeature ( ) |
423427 feature instanceof FeatureHasSinkCallContext or
@@ -2804,11 +2808,7 @@ module Impl<FullStateConfigSig Config> {
28042808 // A PathNode is introduced by a source ...
28052809 Stage5:: revFlow ( node , state ) and
28062810 sourceNode ( node , state ) and
2807- (
2808- if hasSourceCallCtx ( )
2809- then cc instanceof CallContextSomeCall
2810- else cc instanceof CallContextAny
2811- ) and
2811+ sourceCallCtx ( cc ) and
28122812 sc instanceof SummaryCtxNone and
28132813 ap = TAccessPathNil ( node .getDataFlowType ( ) )
28142814 or
@@ -3214,11 +3214,7 @@ module Impl<FullStateConfigSig Config> {
32143214
32153215 override predicate isSource ( ) {
32163216 sourceNode ( node , state ) and
3217- (
3218- if hasSourceCallCtx ( )
3219- then cc instanceof CallContextSomeCall
3220- else cc instanceof CallContextAny
3221- ) and
3217+ sourceCallCtx ( cc ) and
32223218 sc instanceof SummaryCtxNone and
32233219 ap = TAccessPathNil ( node .getDataFlowType ( ) )
32243220 }
Original file line number Diff line number Diff line change @@ -418,6 +418,10 @@ module Impl<FullStateConfigSig Config> {
418418 )
419419 }
420420
421+ private predicate sourceCallCtx ( CallContext cc ) {
422+ if hasSourceCallCtx ( ) then cc instanceof CallContextSomeCall else cc instanceof CallContextAny
423+ }
424+
421425 private predicate hasSinkCallCtx ( ) {
422426 exists ( FlowFeature feature | feature = Config:: getAFeature ( ) |
423427 feature instanceof FeatureHasSinkCallContext or
@@ -2804,11 +2808,7 @@ module Impl<FullStateConfigSig Config> {
28042808 // A PathNode is introduced by a source ...
28052809 Stage5:: revFlow ( node , state ) and
28062810 sourceNode ( node , state ) and
2807- (
2808- if hasSourceCallCtx ( )
2809- then cc instanceof CallContextSomeCall
2810- else cc instanceof CallContextAny
2811- ) and
2811+ sourceCallCtx ( cc ) and
28122812 sc instanceof SummaryCtxNone and
28132813 ap = TAccessPathNil ( node .getDataFlowType ( ) )
28142814 or
@@ -3214,11 +3214,7 @@ module Impl<FullStateConfigSig Config> {
32143214
32153215 override predicate isSource ( ) {
32163216 sourceNode ( node , state ) and
3217- (
3218- if hasSourceCallCtx ( )
3219- then cc instanceof CallContextSomeCall
3220- else cc instanceof CallContextAny
3221- ) and
3217+ sourceCallCtx ( cc ) and
32223218 sc instanceof SummaryCtxNone and
32233219 ap = TAccessPathNil ( node .getDataFlowType ( ) )
32243220 }
Original file line number Diff line number Diff line change @@ -418,6 +418,10 @@ module Impl<FullStateConfigSig Config> {
418418 )
419419 }
420420
421+ private predicate sourceCallCtx ( CallContext cc ) {
422+ if hasSourceCallCtx ( ) then cc instanceof CallContextSomeCall else cc instanceof CallContextAny
423+ }
424+
421425 private predicate hasSinkCallCtx ( ) {
422426 exists ( FlowFeature feature | feature = Config:: getAFeature ( ) |
423427 feature instanceof FeatureHasSinkCallContext or
@@ -2804,11 +2808,7 @@ module Impl<FullStateConfigSig Config> {
28042808 // A PathNode is introduced by a source ...
28052809 Stage5:: revFlow ( node , state ) and
28062810 sourceNode ( node , state ) and
2807- (
2808- if hasSourceCallCtx ( )
2809- then cc instanceof CallContextSomeCall
2810- else cc instanceof CallContextAny
2811- ) and
2811+ sourceCallCtx ( cc ) and
28122812 sc instanceof SummaryCtxNone and
28132813 ap = TAccessPathNil ( node .getDataFlowType ( ) )
28142814 or
@@ -3214,11 +3214,7 @@ module Impl<FullStateConfigSig Config> {
32143214
32153215 override predicate isSource ( ) {
32163216 sourceNode ( node , state ) and
3217- (
3218- if hasSourceCallCtx ( )
3219- then cc instanceof CallContextSomeCall
3220- else cc instanceof CallContextAny
3221- ) and
3217+ sourceCallCtx ( cc ) and
32223218 sc instanceof SummaryCtxNone and
32233219 ap = TAccessPathNil ( node .getDataFlowType ( ) )
32243220 }
Original file line number Diff line number Diff line change @@ -418,6 +418,10 @@ module Impl<FullStateConfigSig Config> {
418418 )
419419 }
420420
421+ private predicate sourceCallCtx ( CallContext cc ) {
422+ if hasSourceCallCtx ( ) then cc instanceof CallContextSomeCall else cc instanceof CallContextAny
423+ }
424+
421425 private predicate hasSinkCallCtx ( ) {
422426 exists ( FlowFeature feature | feature = Config:: getAFeature ( ) |
423427 feature instanceof FeatureHasSinkCallContext or
@@ -2804,11 +2808,7 @@ module Impl<FullStateConfigSig Config> {
28042808 // A PathNode is introduced by a source ...
28052809 Stage5:: revFlow ( node , state ) and
28062810 sourceNode ( node , state ) and
2807- (
2808- if hasSourceCallCtx ( )
2809- then cc instanceof CallContextSomeCall
2810- else cc instanceof CallContextAny
2811- ) and
2811+ sourceCallCtx ( cc ) and
28122812 sc instanceof SummaryCtxNone and
28132813 ap = TAccessPathNil ( node .getDataFlowType ( ) )
28142814 or
@@ -3214,11 +3214,7 @@ module Impl<FullStateConfigSig Config> {
32143214
32153215 override predicate isSource ( ) {
32163216 sourceNode ( node , state ) and
3217- (
3218- if hasSourceCallCtx ( )
3219- then cc instanceof CallContextSomeCall
3220- else cc instanceof CallContextAny
3221- ) and
3217+ sourceCallCtx ( cc ) and
32223218 sc instanceof SummaryCtxNone and
32233219 ap = TAccessPathNil ( node .getDataFlowType ( ) )
32243220 }
Original file line number Diff line number Diff line change @@ -418,6 +418,10 @@ module Impl<FullStateConfigSig Config> {
418418 )
419419 }
420420
421+ private predicate sourceCallCtx ( CallContext cc ) {
422+ if hasSourceCallCtx ( ) then cc instanceof CallContextSomeCall else cc instanceof CallContextAny
423+ }
424+
421425 private predicate hasSinkCallCtx ( ) {
422426 exists ( FlowFeature feature | feature = Config:: getAFeature ( ) |
423427 feature instanceof FeatureHasSinkCallContext or
@@ -2804,11 +2808,7 @@ module Impl<FullStateConfigSig Config> {
28042808 // A PathNode is introduced by a source ...
28052809 Stage5:: revFlow ( node , state ) and
28062810 sourceNode ( node , state ) and
2807- (
2808- if hasSourceCallCtx ( )
2809- then cc instanceof CallContextSomeCall
2810- else cc instanceof CallContextAny
2811- ) and
2811+ sourceCallCtx ( cc ) and
28122812 sc instanceof SummaryCtxNone and
28132813 ap = TAccessPathNil ( node .getDataFlowType ( ) )
28142814 or
@@ -3214,11 +3214,7 @@ module Impl<FullStateConfigSig Config> {
32143214
32153215 override predicate isSource ( ) {
32163216 sourceNode ( node , state ) and
3217- (
3218- if hasSourceCallCtx ( )
3219- then cc instanceof CallContextSomeCall
3220- else cc instanceof CallContextAny
3221- ) and
3217+ sourceCallCtx ( cc ) and
32223218 sc instanceof SummaryCtxNone and
32233219 ap = TAccessPathNil ( node .getDataFlowType ( ) )
32243220 }
Original file line number Diff line number Diff line change @@ -418,6 +418,10 @@ module Impl<FullStateConfigSig Config> {
418418 )
419419 }
420420
421+ private predicate sourceCallCtx ( CallContext cc ) {
422+ if hasSourceCallCtx ( ) then cc instanceof CallContextSomeCall else cc instanceof CallContextAny
423+ }
424+
421425 private predicate hasSinkCallCtx ( ) {
422426 exists ( FlowFeature feature | feature = Config:: getAFeature ( ) |
423427 feature instanceof FeatureHasSinkCallContext or
@@ -2804,11 +2808,7 @@ module Impl<FullStateConfigSig Config> {
28042808 // A PathNode is introduced by a source ...
28052809 Stage5:: revFlow ( node , state ) and
28062810 sourceNode ( node , state ) and
2807- (
2808- if hasSourceCallCtx ( )
2809- then cc instanceof CallContextSomeCall
2810- else cc instanceof CallContextAny
2811- ) and
2811+ sourceCallCtx ( cc ) and
28122812 sc instanceof SummaryCtxNone and
28132813 ap = TAccessPathNil ( node .getDataFlowType ( ) )
28142814 or
@@ -3214,11 +3214,7 @@ module Impl<FullStateConfigSig Config> {
32143214
32153215 override predicate isSource ( ) {
32163216 sourceNode ( node , state ) and
3217- (
3218- if hasSourceCallCtx ( )
3219- then cc instanceof CallContextSomeCall
3220- else cc instanceof CallContextAny
3221- ) and
3217+ sourceCallCtx ( cc ) and
32223218 sc instanceof SummaryCtxNone and
32233219 ap = TAccessPathNil ( node .getDataFlowType ( ) )
32243220 }
Original file line number Diff line number Diff line change @@ -418,6 +418,10 @@ module Impl<FullStateConfigSig Config> {
418418 )
419419 }
420420
421+ private predicate sourceCallCtx ( CallContext cc ) {
422+ if hasSourceCallCtx ( ) then cc instanceof CallContextSomeCall else cc instanceof CallContextAny
423+ }
424+
421425 private predicate hasSinkCallCtx ( ) {
422426 exists ( FlowFeature feature | feature = Config:: getAFeature ( ) |
423427 feature instanceof FeatureHasSinkCallContext or
@@ -2804,11 +2808,7 @@ module Impl<FullStateConfigSig Config> {
28042808 // A PathNode is introduced by a source ...
28052809 Stage5:: revFlow ( node , state ) and
28062810 sourceNode ( node , state ) and
2807- (
2808- if hasSourceCallCtx ( )
2809- then cc instanceof CallContextSomeCall
2810- else cc instanceof CallContextAny
2811- ) and
2811+ sourceCallCtx ( cc ) and
28122812 sc instanceof SummaryCtxNone and
28132813 ap = TAccessPathNil ( node .getDataFlowType ( ) )
28142814 or
@@ -3214,11 +3214,7 @@ module Impl<FullStateConfigSig Config> {
32143214
32153215 override predicate isSource ( ) {
32163216 sourceNode ( node , state ) and
3217- (
3218- if hasSourceCallCtx ( )
3219- then cc instanceof CallContextSomeCall
3220- else cc instanceof CallContextAny
3221- ) and
3217+ sourceCallCtx ( cc ) and
32223218 sc instanceof SummaryCtxNone and
32233219 ap = TAccessPathNil ( node .getDataFlowType ( ) )
32243220 }
Original file line number Diff line number Diff line change @@ -418,6 +418,10 @@ module Impl<FullStateConfigSig Config> {
418418 )
419419 }
420420
421+ private predicate sourceCallCtx ( CallContext cc ) {
422+ if hasSourceCallCtx ( ) then cc instanceof CallContextSomeCall else cc instanceof CallContextAny
423+ }
424+
421425 private predicate hasSinkCallCtx ( ) {
422426 exists ( FlowFeature feature | feature = Config:: getAFeature ( ) |
423427 feature instanceof FeatureHasSinkCallContext or
@@ -2804,11 +2808,7 @@ module Impl<FullStateConfigSig Config> {
28042808 // A PathNode is introduced by a source ...
28052809 Stage5:: revFlow ( node , state ) and
28062810 sourceNode ( node , state ) and
2807- (
2808- if hasSourceCallCtx ( )
2809- then cc instanceof CallContextSomeCall
2810- else cc instanceof CallContextAny
2811- ) and
2811+ sourceCallCtx ( cc ) and
28122812 sc instanceof SummaryCtxNone and
28132813 ap = TAccessPathNil ( node .getDataFlowType ( ) )
28142814 or
@@ -3214,11 +3214,7 @@ module Impl<FullStateConfigSig Config> {
32143214
32153215 override predicate isSource ( ) {
32163216 sourceNode ( node , state ) and
3217- (
3218- if hasSourceCallCtx ( )
3219- then cc instanceof CallContextSomeCall
3220- else cc instanceof CallContextAny
3221- ) and
3217+ sourceCallCtx ( cc ) and
32223218 sc instanceof SummaryCtxNone and
32233219 ap = TAccessPathNil ( node .getDataFlowType ( ) )
32243220 }
You can’t perform that action at this time.
0 commit comments