Merge branch 'main' into js/test-suite

This commit is contained in:
Asger F
2025-01-16 13:19:07 +01:00
committed by GitHub
819 changed files with 66790 additions and 50197 deletions

View File

@@ -3127,6 +3127,14 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
override predicate isSource() { sourceNode(node, state) }
}
bindingset[p, state, t, ap, stored]
pragma[inline_late]
private SummaryCtxSome mkSummaryCtxSome(
ParamNodeEx p, FlowState state, Typ t, Ap ap, TypOption stored
) {
result = TSummaryCtxSome(p, state, t, ap, stored)
}
pragma[nomagic]
private predicate fwdFlowInStep(
ArgNodeEx arg, ParamNodeEx p, FlowState state, Cc outercc, CcCall innercc,
@@ -3138,7 +3146,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
or
FwdFlowInThrough::fwdFlowIn(_, arg, _, p, state, outercc, innercc, outerSummaryCtx, t,
ap, stored, _) and
innerSummaryCtx = TSummaryCtxSome(p, state, t, ap, stored)
innerSummaryCtx = mkSummaryCtxSome(p, state, t, ap, stored)
}
pragma[nomagic]
@@ -3871,11 +3879,6 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
bindingset[node, state, t0, ap]
predicate filter(NodeEx node, FlowState state, Typ t0, Ap ap, Typ t) {
exists(state) and
// We can get away with not using type strengthening here, since we aren't
// going to use the tracked types in the construction of Stage 4 access
// paths. For Stage 4 and onwards, the tracked types must be consistent as
// the cons candidates including types are used to construct subsequent
// access path approximations.
t0 = t and
(
notExpectsContent(node)

View File

@@ -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.

View File

@@ -3,14 +3,19 @@
* 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();
/** Gets the source location of this node. */
Location getLocation();
}
/**
@@ -127,8 +132,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 { }

View File

@@ -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 {