mirror of
https://github.com/github/codeql.git
synced 2026-04-24 00:05:14 +02:00
Ruby: No fieldFlowBranchLimit for SummarizedCallables
This commit is contained in:
@@ -31,4 +31,6 @@ module RubyDataFlow implements InputSig {
|
||||
predicate mayBenefitFromCallContext = Private::mayBenefitFromCallContext/1;
|
||||
|
||||
predicate viableImplInCallContext = Private::viableImplInCallContext/2;
|
||||
|
||||
predicate ignoreFieldFlowBranchLimit(DataFlowCallable c) { exists(c.asLibraryCallable()) }
|
||||
}
|
||||
|
||||
@@ -273,6 +273,9 @@ signature module InputSig {
|
||||
) {
|
||||
any()
|
||||
}
|
||||
|
||||
/** Holds if `fieldFlowBranchLimit` should be ignored for flow going into/out of `c`. */
|
||||
default predicate ignoreFieldFlowBranchLimit(DataFlowCallable c) { none() }
|
||||
}
|
||||
|
||||
module Configs<InputSig Lang> {
|
||||
|
||||
@@ -1117,7 +1117,9 @@ module MakeImpl<InputSig Lang> {
|
||||
exists(int b, int j |
|
||||
b = branch(ret) and
|
||||
j = join(out) and
|
||||
if b.minimum(j) <= Config::fieldFlowBranchLimit()
|
||||
if
|
||||
b.minimum(j) <= Config::fieldFlowBranchLimit() or
|
||||
ignoreFieldFlowBranchLimit(ret.getEnclosingCallable())
|
||||
then allowsFieldFlow = true
|
||||
else allowsFieldFlow = false
|
||||
)
|
||||
@@ -1136,7 +1138,9 @@ module MakeImpl<InputSig Lang> {
|
||||
exists(int b, int j |
|
||||
b = branch(arg) and
|
||||
j = join(p) and
|
||||
if b.minimum(j) <= Config::fieldFlowBranchLimit()
|
||||
if
|
||||
b.minimum(j) <= Config::fieldFlowBranchLimit() or
|
||||
ignoreFieldFlowBranchLimit(p.getEnclosingCallable())
|
||||
then allowsFieldFlow = true
|
||||
else allowsFieldFlow = false
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user