File tree Expand file tree Collapse file tree 3 files changed +10
-15
lines changed
test/library-tests/frameworks/data Expand file tree Collapse file tree 3 files changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -813,12 +813,6 @@ module API {
813
813
lbl = Label:: decoratedMember ( ) and
814
814
ref = DataFlow:: valueNode ( method .getBody ( ) )
815
815
)
816
- or
817
- exists ( Parameter param |
818
- useNodeFlowsToDecorator ( base , param .getADecorator ( ) ) and
819
- lbl = Label:: decoratedParameter ( ) and
820
- ref = DataFlow:: parameterNode ( param )
821
- )
822
816
}
823
817
824
818
/** Holds if `ref` is a use that should have an incoming edge from `base` labelled `lbl`, induced by a decorator. */
@@ -829,6 +823,12 @@ module API {
829
823
lbl = Label:: decoratedMember ( ) and
830
824
ref = DataFlow:: parameterNode ( accessor .getBody ( ) .getParameter ( 0 ) )
831
825
)
826
+ or
827
+ exists ( Parameter param |
828
+ useNodeFlowsToDecorator ( base , param .getADecorator ( ) ) and
829
+ lbl = Label:: decoratedParameter ( ) and
830
+ ref = DataFlow:: parameterNode ( param )
831
+ )
832
832
}
833
833
834
834
/** Holds if `rhs` is a def node that should have an incoming edge from `base` labelled `lbl`, induced by a decorator. */
Original file line number Diff line number Diff line change @@ -6,12 +6,12 @@ class C {
6
6
decoratedParamSource ( @testlib . ParamDecoratorSource x ) {
7
7
sink ( x ) // NOT OK
8
8
}
9
- decoratedParamSink ( @testlib . ParamDecoratorSink x ) { // NOT OK - though slightly weird alert location
9
+ decoratedParamSink ( @testlib . ParamDecoratorSink x ) { // OK
10
10
}
11
11
decoratedParamSink2 ( @testlib . ParamDecoratorSink x ) { // OK
12
- x . push ( source ( ) ) ;
12
+ x . push ( source ( ) ) ; // OK
13
13
}
14
14
}
15
15
16
- new C ( ) . decoratedParamSink ( source ( ) ) ;
17
- new C ( ) . decoratedParamSink2 ( [ ] ) ;
16
+ new C ( ) . decoratedParamSink ( source ( ) ) ; // OK - parameter decorators can't be used to mark the parameter as a sink
17
+ new C ( ) . decoratedParamSink2 ( [ ] ) ; // OK
Original file line number Diff line number Diff line change 1
1
consistencyIssue
2
- | library-tests/frameworks/data/paramDecorator.ts:11 | did not expect an alert, but found an alert for BasicTaintTracking | OK | |
3
2
taintFlow
4
3
| paramDecorator.ts:6:54:6:54 | x | paramDecorator.ts:7:10:7:10 | x |
5
- | paramDecorator.ts:12:12:12:19 | source() | paramDecorator.ts:11:51:11:51 | x |
6
- | paramDecorator.ts:16:28:16:35 | source() | paramDecorator.ts:9:50:9:50 | x |
7
4
| test.js:5:30:5:37 | source() | test.js:5:8:5:38 | testlib ... urce()) |
8
5
| test.js:6:22:6:29 | source() | test.js:6:8:6:30 | preserv ... urce()) |
9
6
| test.js:7:41:7:48 | source() | test.js:7:8:7:49 | require ... urce()) |
@@ -59,8 +56,6 @@ taintFlow
59
56
| test.js:187:31:187:31 | x | test.js:189:10:189:10 | x |
60
57
| test.js:203:32:203:39 | source() | test.js:203:32:203:39 | source() |
61
58
isSink
62
- | paramDecorator.ts:9:50:9:50 | x | test-sink |
63
- | paramDecorator.ts:11:51:11:51 | x | test-sink |
64
59
| test.js:54:18:54:25 | source() | test-sink |
65
60
| test.js:55:22:55:29 | source() | test-sink |
66
61
| test.js:57:24:57:31 | source() | test-sink |
You can’t perform that action at this time.
0 commit comments