mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
Merge pull request #14204 from hvitved/ruby/simplify-viable-callable
Ruby: Simplify `viableSourceCallableNonInit`
This commit is contained in:
@@ -309,8 +309,14 @@ predicate isUserDefinedNew(SingletonMethod new) {
|
||||
}
|
||||
|
||||
private Callable viableSourceCallableNonInit(RelevantCall call) {
|
||||
result = getTarget(call) and
|
||||
not result = blockCall(call) // handled by `lambdaCreation`/`lambdaCall`
|
||||
result = getTargetInstance(call, _)
|
||||
or
|
||||
result = getTargetSingleton(call, _)
|
||||
or
|
||||
exists(Module cls, string method |
|
||||
superCall(call, cls, method) and
|
||||
result = lookupMethod(cls.getAnImmediateAncestor(), method)
|
||||
)
|
||||
}
|
||||
|
||||
private Callable viableSourceCallableInit(RelevantCall call) { result = getInitializeTarget(call) }
|
||||
@@ -400,14 +406,7 @@ private module Cached {
|
||||
|
||||
cached
|
||||
CfgScope getTarget(RelevantCall call) {
|
||||
result = getTargetInstance(call, _)
|
||||
or
|
||||
result = getTargetSingleton(call, _)
|
||||
or
|
||||
exists(Module cls, string method |
|
||||
superCall(call, cls, method) and
|
||||
result = lookupMethod(cls.getAnImmediateAncestor(), method)
|
||||
)
|
||||
result = viableSourceCallableNonInit(call)
|
||||
or
|
||||
result = blockCall(call)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user