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 { }
367
367
* classes as precise as possible: if two subclasses of `BarrierGuardNode` overlap, their
368
368
* implementations of `blocks` will _both_ apply to any configuration that includes either of them.
369
369
*/
370
- abstract class BarrierGuardNode extends BarrierGuardNodeInternal {
371
- // TODO: deprecate this class; currently requires too much refactoring
370
+ abstract deprecated class BarrierGuardNode extends BarrierGuardNodeInternal {
372
371
/**
373
372
* Holds if this node blocks expression `e` provided it evaluates to `outcome`.
374
373
*
Original file line number Diff line number Diff line change @@ -63,13 +63,21 @@ module MakeLabeledBarrierGuard<LabeledBarrierGuardSig BaseGuard> {
63
63
}
64
64
}
65
65
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
+ }
67
75
68
76
/**
69
77
* Converts a labeled barrier guard class to a set of nodes to include in an implementation of `isBarrier(node)` and `isBarrier(node, label)`
70
78
* in a `DataFlow::StateConfigSig` implementation.
71
79
*/
72
- deprecated module MakeLegacyBarrierGuardLabeled< isBarrierGuardSig / 1 isBarrierGuard> {
80
+ deprecated module MakeLegacyBarrierGuardLabeled< DeprecatedSigs :: isBarrierGuardSig / 1 isBarrierGuard> {
73
81
final private class FinalNode = DataFlow:: Node ;
74
82
75
83
private class Adapter extends FinalNode instanceof DataFlow:: BarrierGuardNode {
@@ -100,7 +108,7 @@ deprecated module MakeLegacyBarrierGuardLabeled<isBarrierGuardSig/1 isBarrierGua
100
108
/**
101
109
* Converts a barrier guard class to a set of nodes to include in an implementation of `isBarrier(node)` in a `DataFlow::ConfigSig` implementation.
102
110
*/
103
- deprecated module MakeLegacyBarrierGuard< isBarrierGuardSig / 1 isBarrierGuard> {
111
+ deprecated module MakeLegacyBarrierGuard< DeprecatedSigs :: isBarrierGuardSig / 1 isBarrierGuard> {
104
112
final private class FinalNode = DataFlow:: Node ;
105
113
106
114
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 {
19
19
20
20
module TestFlow = DataFlow:: Global< TestConfig > ;
21
21
22
- class SimpleBarrierGuardNode extends DataFlow:: BarrierGuardNode , DataFlow :: InvokeNode {
22
+ class SimpleBarrierGuardNode extends DataFlow:: InvokeNode {
23
23
SimpleBarrierGuardNode ( ) { this .getCalleeName ( ) = "BARRIER" }
24
24
25
- override predicate blocks ( boolean outcome , Expr e ) { this .blocksExpr ( outcome , e ) }
26
-
27
25
predicate blocksExpr ( boolean outcome , Expr e ) {
28
26
outcome = true and
29
27
e = this .getArgument ( 0 ) .asExpr ( )
30
28
}
31
29
}
32
30
31
+ deprecated class SimpleBarrierGuardNodeLegacy extends DataFlow:: BarrierGuardNode instanceof SimpleBarrierGuardNode
32
+ {
33
+ override predicate blocks ( boolean outcome , Expr e ) { super .blocksExpr ( outcome , e ) }
34
+ }
35
+
33
36
deprecated class LegacyConfig extends DataFlow:: Configuration {
34
37
LegacyConfig ( ) { this = "LegacyConfig" }
35
38
@@ -38,7 +41,7 @@ deprecated class LegacyConfig extends DataFlow::Configuration {
38
41
override predicate isSink ( DataFlow:: Node sink ) { TestConfig:: isSink ( sink ) }
39
42
40
43
override predicate isBarrierGuard ( DataFlow:: BarrierGuardNode guard ) {
41
- guard instanceof SimpleBarrierGuardNode
44
+ guard instanceof SimpleBarrierGuardNodeLegacy
42
45
}
43
46
}
44
47
Original file line number Diff line number Diff line change @@ -22,8 +22,9 @@ class BasicBarrierGuard extends DataFlow::CallNode {
22
22
}
23
23
}
24
24
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 ) }
27
28
}
28
29
29
30
deprecated class LegacyConfig extends DataFlow:: Configuration {
You can’t perform that action at this time.
0 commit comments