File tree Expand file tree Collapse file tree 4 files changed +22
-11
lines changed
lib/semmle/javascript/dataflow Expand file tree Collapse file tree 4 files changed +22
-11
lines changed Original file line number Diff line number Diff line change @@ -367,8 +367,7 @@ abstract private class BarrierGuardNodeInternal extends DataFlow::Node { }
367367 * classes as precise as possible: if two subclasses of `BarrierGuardNode` overlap, their
368368 * implementations of `blocks` will _both_ apply to any configuration that includes either of them.
369369 */
370- abstract class BarrierGuardNode extends BarrierGuardNodeInternal {
371- // TODO: deprecate this class; currently requires too much refactoring
370+ abstract deprecated class BarrierGuardNode extends BarrierGuardNodeInternal {
372371 /**
373372 * Holds if this node blocks expression `e` provided it evaluates to `outcome`.
374373 *
Original file line number Diff line number Diff line change @@ -63,13 +63,21 @@ module MakeLabeledBarrierGuard<LabeledBarrierGuardSig BaseGuard> {
6363 }
6464}
6565
66- deprecated private signature predicate isBarrierGuardSig ( DataFlow:: BarrierGuardNode node ) ;
66+ /**
67+ * Contains deprecated signatures.
68+ *
69+ * This module is a workaround for the fact that deprecated signatures can't refer to deprecated classes
70+ * without getting a deprecation warning
71+ */
72+ deprecated private module DeprecatedSigs {
73+ signature predicate isBarrierGuardSig ( DataFlow:: BarrierGuardNode node ) ;
74+ }
6775
6876/**
6977 * Converts a labeled barrier guard class to a set of nodes to include in an implementation of `isBarrier(node)` and `isBarrier(node, label)`
7078 * in a `DataFlow::StateConfigSig` implementation.
7179 */
72- deprecated module MakeLegacyBarrierGuardLabeled< isBarrierGuardSig / 1 isBarrierGuard> {
80+ deprecated module MakeLegacyBarrierGuardLabeled< DeprecatedSigs :: isBarrierGuardSig / 1 isBarrierGuard> {
7381 final private class FinalNode = DataFlow:: Node ;
7482
7583 private class Adapter extends FinalNode instanceof DataFlow:: BarrierGuardNode {
@@ -100,7 +108,7 @@ deprecated module MakeLegacyBarrierGuardLabeled<isBarrierGuardSig/1 isBarrierGua
100108/**
101109 * Converts a barrier guard class to a set of nodes to include in an implementation of `isBarrier(node)` in a `DataFlow::ConfigSig` implementation.
102110 */
103- deprecated module MakeLegacyBarrierGuard< isBarrierGuardSig / 1 isBarrierGuard> {
111+ deprecated module MakeLegacyBarrierGuard< DeprecatedSigs :: isBarrierGuardSig / 1 isBarrierGuard> {
104112 final private class FinalNode = DataFlow:: Node ;
105113
106114 private class Adapter extends FinalNode instanceof DataFlow:: BarrierGuardNode {
Original file line number Diff line number Diff line change @@ -19,17 +19,20 @@ module TestConfig implements DataFlow::ConfigSig {
1919
2020module TestFlow = DataFlow:: Global< TestConfig > ;
2121
22- class SimpleBarrierGuardNode extends DataFlow:: BarrierGuardNode , DataFlow :: InvokeNode {
22+ class SimpleBarrierGuardNode extends DataFlow:: InvokeNode {
2323 SimpleBarrierGuardNode ( ) { this .getCalleeName ( ) = "BARRIER" }
2424
25- override predicate blocks ( boolean outcome , Expr e ) { this .blocksExpr ( outcome , e ) }
26-
2725 predicate blocksExpr ( boolean outcome , Expr e ) {
2826 outcome = true and
2927 e = this .getArgument ( 0 ) .asExpr ( )
3028 }
3129}
3230
31+ deprecated class SimpleBarrierGuardNodeLegacy extends DataFlow:: BarrierGuardNode instanceof SimpleBarrierGuardNode
32+ {
33+ override predicate blocks ( boolean outcome , Expr e ) { super .blocksExpr ( outcome , e ) }
34+ }
35+
3336deprecated class LegacyConfig extends DataFlow:: Configuration {
3437 LegacyConfig ( ) { this = "LegacyConfig" }
3538
@@ -38,7 +41,7 @@ deprecated class LegacyConfig extends DataFlow::Configuration {
3841 override predicate isSink ( DataFlow:: Node sink ) { TestConfig:: isSink ( sink ) }
3942
4043 override predicate isBarrierGuard ( DataFlow:: BarrierGuardNode guard ) {
41- guard instanceof SimpleBarrierGuardNode
44+ guard instanceof SimpleBarrierGuardNodeLegacy
4245 }
4346}
4447
Original file line number Diff line number Diff line change @@ -22,8 +22,9 @@ class BasicBarrierGuard extends DataFlow::CallNode {
2222 }
2323}
2424
25- deprecated class BasicBarrierGuardLegacy extends DataFlow:: BarrierGuardNode , BasicBarrierGuard {
26- override predicate blocks ( boolean outcome , Expr e ) { this .blocksExpr ( outcome , e ) }
25+ deprecated class BasicBarrierGuardLegacy extends DataFlow:: BarrierGuardNode instanceof BasicBarrierGuard
26+ {
27+ override predicate blocks ( boolean outcome , Expr e ) { super .blocksExpr ( outcome , e ) }
2728}
2829
2930deprecated class LegacyConfig extends DataFlow:: Configuration {
You can’t perform that action at this time.
0 commit comments