Add support for flow summaries

This commit is contained in:
Tom Hvitved
2021-08-25 15:49:03 +02:00
parent c183e05c49
commit 08dc6d79ef
16 changed files with 1520 additions and 86 deletions

View File

@@ -13,7 +13,6 @@
import ruby
import codeql.ruby.ast.internal.Module
import codeql.ruby.dataflow.SSA
import codeql.ruby.dataflow.internal.DataFlowDispatch
from DefLoc loc, Expr src, Expr target, string kind
where
@@ -38,9 +37,7 @@ newtype DefLoc =
/** A constant, module or class. */
ConstantDefLoc(ConstantReadAccess read, ConstantWriteAccess write) { write = definitionOf(read) } or
/** A method call. */
MethodLoc(MethodCall call, Method meth) {
exists(DataFlowCall c | c.getExpr() = call and c.getTarget() = meth)
} or
MethodLoc(MethodCall call, Method meth) { meth = call.getATarget() } or
/** A local variable. */
LocalVariableLoc(VariableReadAccess read, VariableWriteAccess write) {
exists(Ssa::WriteDefinition w |