Skip to content

Commit 82069cf

Browse files
Esben Sparre AndreasenStephan Brandauer
authored andcommitted
remove Input_ArgumentIndexAndAccessPathFromCallee
1 parent 095beb3 commit 82069cf

2 files changed

Lines changed: 1 addition & 48 deletions

File tree

javascript/ql/experimental/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/EndpointFeatures.qll

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ private newtype TEndpointFeature =
231231
TCalleeAccessPathWithStructuralInfo() or
232232
TEnclosingFunctionBody() or
233233
TCallee_AccessPath() or
234-
TInput_ArgumentIndexAndAccessPathFromCallee() or
235234
TInput_AccessPathFromCallee() or
236235
TInput_ArgumentIndex()
237236

@@ -561,43 +560,12 @@ class Callee_AccessPath extends EndpointFeature, TCallee_AccessPath {
561560
}
562561
}
563562

564-
/**
565-
* The feature for how a callee can refer to a the endpoint that is "contained" in an argument to a call
566-
*
567-
* "Containment" is syntactic, and currently means that the endpoint is an argument to the call, or that the endpoint is a (nested) property value of an argument.
568-
*
569-
* This feature is intended as a superior version of the `ArgumentIndexFeature`.
570-
*
571-
* Examples:
572-
* ```
573-
* foo(endpoint); // -> 0
574-
* foo({ bar: endpoint }); // -> 0.bar
575-
* foo(x, { bar: { baz: endpoint } }); // -> 1.bar.baz
576-
* ```
577-
*/
578-
class Input_ArgumentIndexAndAccessPathFromCallee extends EndpointFeature,
579-
TInput_ArgumentIndexAndAccessPathFromCallee {
580-
override string getName() { result = "Input_ArgumentIndexAndAccessPathFromCallee" }
581-
582-
override string getValue(DataFlow::Node endpoint) {
583-
exists(DataFlow::InvokeNode invk |
584-
result = SyntacticUtilities::getSimpleParameterAccessPath(endpoint) and
585-
(
586-
invk.getAnArgument() = endpoint or
587-
SyntacticUtilities::getANestedInitializerValue(invk.getAnArgument()
588-
.asExpr()
589-
.getUnderlyingValue()).flow() = endpoint
590-
)
591-
)
592-
}
593-
}
594-
595563
/**
596564
* The feature for how a callee can refer to a the endpoint that is "contained" in some argument to a call
597565
*
598566
* "Containment" is syntactic, and currently means that the endpoint is an argument to the call, or that the endpoint is a (nested) property value of an argument.
599567
*
600-
* This feature is intended as a superior version of the `ArgumentIndexFeature`.
568+
* This feature, together with `Input_ArgumentIndex` is intended as a far superior version of the `ArgumentIndexFeature`.
601569
*
602570
* Examples:
603571
* ```

javascript/ql/experimental/adaptivethreatmodeling/test/generic_feature_testing/FeatureValue.expected

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
| test.html:2:61:2:68 | endpoint | Callee_AccessPath | $event.target.files.item |
22
| test.html:2:61:2:68 | endpoint | Input_ArgumentIndex | 0 |
3-
| test.html:2:61:2:68 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0 |
43
| test.html:2:61:2:68 | endpoint | argumentIndex | 0 |
54
| test.html:2:61:2:68 | endpoint | calleeAccessPath | |
65
| test.html:2:61:2:68 | endpoint | calleeAccessPathWithStructuralInfo | |
76
| test.html:2:61:2:68 | endpoint | calleeName | item |
87
| test.js:2:7:2:14 | endpoint | Callee_AccessPath | f |
98
| test.js:2:7:2:14 | endpoint | Input_ArgumentIndex | 0 |
10-
| test.js:2:7:2:14 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0 |
119
| test.js:2:7:2:14 | endpoint | argumentIndex | 0 |
1210
| test.js:2:7:2:14 | endpoint | calleeAccessPath | |
1311
| test.js:2:7:2:14 | endpoint | calleeAccessPathWithStructuralInfo | |
@@ -17,22 +15,19 @@
1715
| test.js:3:11:3:18 | endpoint | Callee_AccessPath | f |
1816
| test.js:3:11:3:18 | endpoint | Input_AccessPathFromCallee | 0.p |
1917
| test.js:3:11:3:18 | endpoint | Input_ArgumentIndex | 0 |
20-
| test.js:3:11:3:18 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0.p |
2118
| test.js:3:11:3:18 | endpoint | calleeAccessPath | |
2219
| test.js:3:11:3:18 | endpoint | calleeAccessPathWithStructuralInfo | |
2320
| test.js:3:11:3:18 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint |
2421
| test.js:3:11:3:18 | endpoint | enclosingFunctionName | |
2522
| test.js:4:15:4:22 | endpoint | Callee_AccessPath | f |
2623
| test.js:4:15:4:22 | endpoint | Input_AccessPathFromCallee | 0.p.q |
2724
| test.js:4:15:4:22 | endpoint | Input_ArgumentIndex | 0 |
28-
| test.js:4:15:4:22 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0.p.q |
2925
| test.js:4:15:4:22 | endpoint | calleeAccessPath | |
3026
| test.js:4:15:4:22 | endpoint | calleeAccessPathWithStructuralInfo | |
3127
| test.js:4:15:4:22 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint |
3228
| test.js:4:15:4:22 | endpoint | enclosingFunctionName | |
3329
| test.js:5:9:5:16 | endpoint | Callee_AccessPath | o.m |
3430
| test.js:5:9:5:16 | endpoint | Input_ArgumentIndex | 0 |
35-
| test.js:5:9:5:16 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0 |
3631
| test.js:5:9:5:16 | endpoint | argumentIndex | 0 |
3732
| test.js:5:9:5:16 | endpoint | calleeAccessPath | |
3833
| test.js:5:9:5:16 | endpoint | calleeAccessPathWithStructuralInfo | |
@@ -43,29 +38,25 @@
4338
| test.js:6:13:6:20 | endpoint | Callee_AccessPath | o.m |
4439
| test.js:6:13:6:20 | endpoint | Input_AccessPathFromCallee | 0.p |
4540
| test.js:6:13:6:20 | endpoint | Input_ArgumentIndex | 0 |
46-
| test.js:6:13:6:20 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0.p |
4741
| test.js:6:13:6:20 | endpoint | calleeAccessPath | |
4842
| test.js:6:13:6:20 | endpoint | calleeAccessPathWithStructuralInfo | |
4943
| test.js:6:13:6:20 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint |
5044
| test.js:6:13:6:20 | endpoint | enclosingFunctionName | |
5145
| test.js:7:17:7:24 | endpoint | Callee_AccessPath | o.m |
5246
| test.js:7:17:7:24 | endpoint | Input_AccessPathFromCallee | 0.p.q |
5347
| test.js:7:17:7:24 | endpoint | Input_ArgumentIndex | 0 |
54-
| test.js:7:17:7:24 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0.p.q |
5548
| test.js:7:17:7:24 | endpoint | calleeAccessPath | |
5649
| test.js:7:17:7:24 | endpoint | calleeAccessPathWithStructuralInfo | |
5750
| test.js:7:17:7:24 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint |
5851
| test.js:7:17:7:24 | endpoint | enclosingFunctionName | |
5952
| test.js:8:11:8:18 | endpoint | Callee_AccessPath | F |
6053
| test.js:8:11:8:18 | endpoint | Input_ArgumentIndex | 0 |
61-
| test.js:8:11:8:18 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | ? |
6254
| test.js:8:11:8:18 | endpoint | calleeAccessPath | |
6355
| test.js:8:11:8:18 | endpoint | calleeAccessPathWithStructuralInfo | |
6456
| test.js:8:11:8:18 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint |
6557
| test.js:8:11:8:18 | endpoint | enclosingFunctionName | |
6658
| test.js:9:17:9:24 | endpoint | Callee_AccessPath | o.m().m().m |
6759
| test.js:9:17:9:24 | endpoint | Input_ArgumentIndex | 0 |
68-
| test.js:9:17:9:24 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0 |
6960
| test.js:9:17:9:24 | endpoint | argumentIndex | 0 |
7061
| test.js:9:17:9:24 | endpoint | calleeAccessPath | |
7162
| test.js:9:17:9:24 | endpoint | calleeAccessPathWithStructuralInfo | |
@@ -74,15 +65,13 @@
7465
| test.js:9:17:9:24 | endpoint | enclosingFunctionName | |
7566
| test.js:10:9:10:16 | endpoint | Callee_AccessPath | f() |
7667
| test.js:10:9:10:16 | endpoint | Input_ArgumentIndex | 0 |
77-
| test.js:10:9:10:16 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0 |
7868
| test.js:10:9:10:16 | endpoint | argumentIndex | 0 |
7969
| test.js:10:9:10:16 | endpoint | calleeAccessPath | |
8070
| test.js:10:9:10:16 | endpoint | calleeAccessPathWithStructuralInfo | |
8171
| test.js:10:9:10:16 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint |
8272
| test.js:10:9:10:16 | endpoint | enclosingFunctionName | |
8373
| test.js:11:12:11:19 | endpoint | Callee_AccessPath | o.?.m |
8474
| test.js:11:12:11:19 | endpoint | Input_ArgumentIndex | 0 |
85-
| test.js:11:12:11:19 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0 |
8675
| test.js:11:12:11:19 | endpoint | argumentIndex | 0 |
8776
| test.js:11:12:11:19 | endpoint | calleeAccessPath | |
8877
| test.js:11:12:11:19 | endpoint | calleeAccessPathWithStructuralInfo | |
@@ -91,7 +80,6 @@
9180
| test.js:11:12:11:19 | endpoint | enclosingFunctionName | |
9281
| test.js:12:16:12:23 | endpoint | Callee_AccessPath | o.m.?.p.m |
9382
| test.js:12:16:12:23 | endpoint | Input_ArgumentIndex | 0 |
94-
| test.js:12:16:12:23 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0 |
9583
| test.js:12:16:12:23 | endpoint | argumentIndex | 0 |
9684
| test.js:12:16:12:23 | endpoint | calleeAccessPath | |
9785
| test.js:12:16:12:23 | endpoint | calleeAccessPathWithStructuralInfo | |
@@ -100,15 +88,13 @@
10088
| test.js:12:16:12:23 | endpoint | enclosingFunctionName | |
10189
| test.js:13:15:13:22 | endpoint | Callee_AccessPath | (await p) |
10290
| test.js:13:15:13:22 | endpoint | Input_ArgumentIndex | 0 |
103-
| test.js:13:15:13:22 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0 |
10491
| test.js:13:15:13:22 | endpoint | argumentIndex | 0 |
10592
| test.js:13:15:13:22 | endpoint | calleeAccessPath | |
10693
| test.js:13:15:13:22 | endpoint | calleeAccessPathWithStructuralInfo | |
10794
| test.js:13:15:13:22 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint |
10895
| test.js:13:15:13:22 | endpoint | enclosingFunctionName | |
10996
| test.js:14:27:14:34 | endpoint | Callee_AccessPath | import(!).bar.baz |
11097
| test.js:14:27:14:34 | endpoint | Input_ArgumentIndex | 0 |
111-
| test.js:14:27:14:34 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0 |
11298
| test.js:14:27:14:34 | endpoint | argumentIndex | 0 |
11399
| test.js:14:27:14:34 | endpoint | calleeAccessPath | foo bar baz |
114100
| test.js:14:27:14:34 | endpoint | calleeAccessPathWithStructuralInfo | foo member bar member baz instanceorreturn |
@@ -118,7 +104,6 @@
118104
| test.js:14:27:14:34 | endpoint | enclosingFunctionName | |
119105
| test.js:16:13:16:20 | endpoint | Callee_AccessPath | bar |
120106
| test.js:16:13:16:20 | endpoint | Input_ArgumentIndex | 0 |
121-
| test.js:16:13:16:20 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0 |
122107
| test.js:16:13:16:20 | endpoint | argumentIndex | 0 |
123108
| test.js:16:13:16:20 | endpoint | calleeAccessPath | |
124109
| test.js:16:13:16:20 | endpoint | calleeAccessPathWithStructuralInfo | |

0 commit comments

Comments
 (0)