Skip to content

Commit 0056c39

Browse files
committed
JS: Deprecate AdditionalFlowStep
1 parent 9e6aac8 commit 0056c39

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

javascript/ql/src/semmle/javascript/dataflow/Configuration.qll

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -544,14 +544,23 @@ abstract class LabeledBarrierGuardNode extends BarrierGuardNode {
544544
}
545545

546546
/**
547+
* DEPRECATED. Subclasses should extend `SharedFlowStep` instead, unless the subclass
548+
* is part of a query, in which case it should be moved into the `isAdditionalFlowStep` predicate
549+
* of the relevant data-flow configuration.
550+
* Other uses of the predicate in this class should instead reference the predicates in the
551+
* `SharedFlowStep::` module, such as `SharedFlowStep::step`.
552+
*
547553
* A data flow edge that should be added to all data flow configurations in
548554
* addition to standard data flow edges.
549555
*
550556
* Note: For performance reasons, all subclasses of this class should be part
551557
* of the standard library. Override `Configuration::isAdditionalFlowStep`
552558
* for analysis-specific flow steps.
553559
*/
554-
abstract class AdditionalFlowStep extends DataFlow::Node {
560+
deprecated class AdditionalFlowStep = LegacyAdditionalFlowStep;
561+
562+
// Internal version of AdditionalFlowStep that we can reference without deprecation warnings.
563+
abstract private class LegacyAdditionalFlowStep extends DataFlow::Node {
555564
/**
556565
* Holds if `pred` → `succ` should be considered a data flow edge.
557566
*/
@@ -729,32 +738,32 @@ module SharedFlowStep {
729738
*/
730739
private class AdditionalFlowStepAsSharedStep extends SharedFlowStep {
731740
override predicate step(DataFlow::Node pred, DataFlow::Node succ) {
732-
any(AdditionalFlowStep s).step(pred, succ)
741+
any(LegacyAdditionalFlowStep s).step(pred, succ)
733742
}
734743

735744
override predicate step(
736745
DataFlow::Node pred, DataFlow::Node succ, DataFlow::FlowLabel predlbl,
737746
DataFlow::FlowLabel succlbl
738747
) {
739-
any(AdditionalFlowStep s).step(pred, succ, predlbl, succlbl)
748+
any(LegacyAdditionalFlowStep s).step(pred, succ, predlbl, succlbl)
740749
}
741750

742751
override predicate storeStep(DataFlow::Node pred, DataFlow::SourceNode succ, string prop) {
743-
any(AdditionalFlowStep s).storeStep(pred, succ, prop)
752+
any(LegacyAdditionalFlowStep s).storeStep(pred, succ, prop)
744753
}
745754

746755
override predicate loadStep(DataFlow::Node pred, DataFlow::Node succ, string prop) {
747-
any(AdditionalFlowStep s).loadStep(pred, succ, prop)
756+
any(LegacyAdditionalFlowStep s).loadStep(pred, succ, prop)
748757
}
749758

750759
override predicate loadStoreStep(DataFlow::Node pred, DataFlow::Node succ, string prop) {
751-
any(AdditionalFlowStep s).loadStoreStep(pred, succ, prop)
760+
any(LegacyAdditionalFlowStep s).loadStoreStep(pred, succ, prop)
752761
}
753762

754763
override predicate loadStoreStep(
755764
DataFlow::Node pred, DataFlow::Node succ, string loadProp, string storeProp
756765
) {
757-
any(AdditionalFlowStep s).loadStoreStep(pred, succ, loadProp, storeProp)
766+
any(LegacyAdditionalFlowStep s).loadStoreStep(pred, succ, loadProp, storeProp)
758767
}
759768
}
760769

0 commit comments

Comments
 (0)