File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
ruby/ql/lib/codeql/ruby/dataflow/internal
shared/dataflow/codeql/dataflow Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -31,4 +31,6 @@ module RubyDataFlow implements InputSig {
3131 predicate mayBenefitFromCallContext = Private:: mayBenefitFromCallContext / 1 ;
3232
3333 predicate viableImplInCallContext = Private:: viableImplInCallContext / 2 ;
34+
35+ predicate ignoreFieldFlowBranchLimit ( DataFlowCallable c ) { exists ( c .asLibraryCallable ( ) ) }
3436}
Original file line number Diff line number Diff line change @@ -273,6 +273,9 @@ signature module InputSig {
273273 ) {
274274 any ( )
275275 }
276+
277+ /** Holds if `fieldFlowBranchLimit` should be ignored for flow going into/out of `c`. */
278+ default predicate ignoreFieldFlowBranchLimit ( DataFlowCallable c ) { none ( ) }
276279}
277280
278281module Configs< InputSig Lang> {
Original file line number Diff line number Diff line change @@ -1117,7 +1117,9 @@ module MakeImpl<InputSig Lang> {
11171117 exists ( int b , int j |
11181118 b = branch ( ret ) and
11191119 j = join ( out ) and
1120- if b .minimum ( j ) <= Config:: fieldFlowBranchLimit ( )
1120+ if
1121+ b .minimum ( j ) <= Config:: fieldFlowBranchLimit ( ) or
1122+ ignoreFieldFlowBranchLimit ( ret .getEnclosingCallable ( ) )
11211123 then allowsFieldFlow = true
11221124 else allowsFieldFlow = false
11231125 )
@@ -1136,7 +1138,9 @@ module MakeImpl<InputSig Lang> {
11361138 exists ( int b , int j |
11371139 b = branch ( arg ) and
11381140 j = join ( p ) and
1139- if b .minimum ( j ) <= Config:: fieldFlowBranchLimit ( )
1141+ if
1142+ b .minimum ( j ) <= Config:: fieldFlowBranchLimit ( ) or
1143+ ignoreFieldFlowBranchLimit ( p .getEnclosingCallable ( ) )
11401144 then allowsFieldFlow = true
11411145 else allowsFieldFlow = false
11421146 )
You can’t perform that action at this time.
0 commit comments