1313import ruby
1414import codeql_ruby.ast.internal.Module
1515import codeql_ruby.dataflow.SSA
16+ import codeql_ruby.dataflow.internal.DataFlowDispatch
1617
1718from DefLoc loc , Expr src , Expr target , string kind
1819where
1920 ConstantDefLoc ( src , target ) = loc and kind = "constant"
2021 or
21- LocalMethodLoc ( src , target ) = loc and kind = "method"
22+ MethodLoc ( src , target ) = loc and kind = "method"
2223 or
2324 LocalVariableLoc ( src , target ) = loc and kind = "variable"
2425 or
@@ -36,10 +37,9 @@ select src, target, kind
3637newtype DefLoc =
3738 /** A constant, module or class. */
3839 ConstantDefLoc ( ConstantReadAccess read , ConstantWriteAccess write ) { write = definitionOf ( read ) } or
39- /** A call to a method that is defined in the same class as the call. */
40- LocalMethodLoc ( MethodCall call , Method meth ) {
41- meth = lookupMethod ( call .getEnclosingModule ( ) .getModule ( ) , call .getMethodName ( ) ) and
42- call .getReceiver ( ) instanceof Self
40+ /** A method call. */
41+ MethodLoc ( MethodCall call , Method meth ) {
42+ exists ( DataFlowCall c | c .getExpr ( ) = call and c .getTarget ( ) = meth )
4343 } or
4444 /** A local variable. */
4545 LocalVariableLoc ( VariableReadAccess read , VariableWriteAccess write ) {
0 commit comments