mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
shared: add locations to typetracking nodes
This commit is contained in:
@@ -334,7 +334,7 @@ private module TrackLambda<methodDispatchSig/1 lambdaDispatch0> {
|
||||
)
|
||||
}
|
||||
|
||||
private module TtInput implements TypeTrackingInput {
|
||||
private module TtInput implements TypeTrackingInput<Location> {
|
||||
import TypeTrackingSteps
|
||||
|
||||
predicate callStep(Node n1, LocalSourceNode n2) { argParamCand(n1, n2) }
|
||||
@@ -348,7 +348,7 @@ private module TrackLambda<methodDispatchSig/1 lambdaDispatch0> {
|
||||
}
|
||||
}
|
||||
|
||||
private import TypeTracking<TtInput>::TypeTrack<lambdaSource/1>::Graph<lambdaSink/1>
|
||||
private import TypeTracking<Location, TtInput>::TypeTrack<lambdaSource/1>::Graph<lambdaSink/1>
|
||||
|
||||
private predicate edgePlus(PathNode n1, PathNode n2) = fastTC(edges/2)(n1, n2)
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
*/
|
||||
|
||||
private import internal.TypeTrackingImpl as Impl
|
||||
import Impl::Shared::TypeTracking<Impl::TypeTrackingInput>
|
||||
private import semmle.python.Files
|
||||
import Impl::Shared::TypeTracking<Location, Impl::TypeTrackingInput>
|
||||
private import semmle.python.dataflow.new.internal.DataFlowPublic as DataFlowPublic
|
||||
|
||||
/**
|
||||
|
||||
@@ -106,7 +106,7 @@ private module SummaryTypeTrackerInput implements SummaryTypeTracker::Input {
|
||||
|
||||
private module TypeTrackerSummaryFlow = SummaryTypeTracker::SummaryFlow<SummaryTypeTrackerInput>;
|
||||
|
||||
module TypeTrackingInput implements Shared::TypeTrackingInput {
|
||||
module TypeTrackingInput implements Shared::TypeTrackingInput<Location> {
|
||||
class Node = DataFlowPublic::Node;
|
||||
|
||||
class LocalSourceNode = DataFlowPublic::LocalSourceNode;
|
||||
@@ -318,9 +318,9 @@ module TypeTrackingInput implements Shared::TypeTrackingInput {
|
||||
capturedJumpStep(nodeFrom, nodeTo)
|
||||
}
|
||||
|
||||
predicate hasFeatureBacktrackStoreTarget() { any() }
|
||||
predicate hasFeatureBacktrackStoreTarget() { none() }
|
||||
|
||||
predicate nonStandardFlowsTo(LocalSourceNode localSource, Node dst) { localSource.flowsTo(dst) }
|
||||
}
|
||||
|
||||
import SharedImpl::TypeTracking<TypeTrackingInput>
|
||||
import SharedImpl::TypeTracking<Location, TypeTrackingInput>
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
* for tracking types.
|
||||
*/
|
||||
|
||||
private import codeql.ruby.AST
|
||||
private import codeql.ruby.typetracking.internal.TypeTrackingImpl as Impl
|
||||
import Impl::Shared::TypeTracking<Impl::TypeTrackingInput>
|
||||
import Impl::Shared::TypeTracking<Location, Impl::TypeTrackingInput>
|
||||
|
||||
@@ -265,7 +265,7 @@ private module TypeTrackerSummaryFlow = SummaryTypeTracker::SummaryFlow<SummaryT
|
||||
|
||||
private newtype TContentFilter = MkElementFilter()
|
||||
|
||||
module TypeTrackingInput implements Shared::TypeTrackingInput {
|
||||
module TypeTrackingInput implements Shared::TypeTrackingInput<Location> {
|
||||
class Node = DataFlowPublic::Node;
|
||||
|
||||
class LocalSourceNode = DataFlowPublic::LocalSourceNode;
|
||||
@@ -467,4 +467,4 @@ module TypeTrackingInput implements Shared::TypeTrackingInput {
|
||||
predicate hasFeatureBacktrackStoreTarget() { none() }
|
||||
}
|
||||
|
||||
import SharedImpl::TypeTracking<TypeTrackingInput>
|
||||
import SharedImpl::TypeTracking<Location, TypeTrackingInput>
|
||||
|
||||
@@ -80,7 +80,7 @@ module MakeImplCommon<LocationSig Location, InputSig<Location> Lang> {
|
||||
}
|
||||
}
|
||||
|
||||
private module TypeTrackingInput implements Tt::TypeTrackingInput {
|
||||
private module TypeTrackingInput implements Tt::TypeTrackingInput<Location> {
|
||||
final class Node = Lang::Node;
|
||||
|
||||
class LocalSourceNode extends Node {
|
||||
@@ -145,7 +145,7 @@ module MakeImplCommon<LocationSig Location, InputSig<Location> Lang> {
|
||||
predicate hasFeatureBacktrackStoreTarget() { none() }
|
||||
}
|
||||
|
||||
private module TypeTracking = Tt::TypeTracking<TypeTrackingInput>;
|
||||
private module TypeTracking = Tt::TypeTracking<Location, TypeTrackingInput>;
|
||||
|
||||
/**
|
||||
* The cost limits for the `AccessPathFront` to `AccessPathApprox` expansion.
|
||||
|
||||
@@ -3,14 +3,18 @@
|
||||
* for tracking types.
|
||||
*/
|
||||
|
||||
private import codeql.util.Location
|
||||
|
||||
/**
|
||||
* The step relations for type tracking.
|
||||
*/
|
||||
signature module TypeTrackingInput {
|
||||
signature module TypeTrackingInput<LocationSig Location> {
|
||||
/** A node that is used by the type-trackers. */
|
||||
class Node {
|
||||
/** Gets a textual representation of this node. */
|
||||
string toString();
|
||||
|
||||
Location getLocation();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -127,8 +131,8 @@ private import internal.TypeTrackingImpl as Impl
|
||||
* Given a set of step relations, this module provides classes and predicates
|
||||
* for simple data-flow reachability suitable for tracking types.
|
||||
*/
|
||||
module TypeTracking<TypeTrackingInput I> {
|
||||
private module MkImpl = Impl::TypeTracking<I>;
|
||||
module TypeTracking<LocationSig Location, TypeTrackingInput<Location> I> {
|
||||
private module MkImpl = Impl::TypeTracking<Location, I>;
|
||||
|
||||
private module ConsistencyChecksInput implements MkImpl::ConsistencyChecksInputSig { }
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
private import codeql.util.Boolean
|
||||
private import codeql.util.Option
|
||||
private import codeql.typetracking.TypeTracking
|
||||
private import codeql.util.Location
|
||||
|
||||
/**
|
||||
* Given a set of step relations, this module provides classes and predicates
|
||||
@@ -14,7 +15,7 @@ private import codeql.typetracking.TypeTracking
|
||||
* The constructed module contains both public and internal logic; the public
|
||||
* interface is exposed via `codeql.typetracking.TypeTracking`.
|
||||
*/
|
||||
module TypeTracking<TypeTrackingInput I> {
|
||||
module TypeTracking<LocationSig Location, TypeTrackingInput<Location> I> {
|
||||
private import I
|
||||
|
||||
signature module ConsistencyChecksInputSig {
|
||||
|
||||
Reference in New Issue
Block a user