mirror of
https://github.com/github/codeql.git
synced 2026-05-05 13:45:19 +02:00
Add support for TypeVar[x] and typeVariable rows
This commit is contained in:
@@ -58,6 +58,10 @@ taintFlow
|
||||
| test.js:207:24:207:31 | source() | test.js:207:24:207:31 | source() |
|
||||
| test.js:208:24:208:31 | source() | test.js:208:24:208:31 | source() |
|
||||
| test.js:211:34:211:41 | source() | test.js:211:34:211:41 | source() |
|
||||
| test.js:214:34:214:41 | source() | test.js:214:34:214:41 | source() |
|
||||
| test.js:223:45:223:52 | source() | test.js:223:45:223:52 | source() |
|
||||
| test.js:225:39:225:46 | source() | test.js:225:39:225:46 | source() |
|
||||
| test.js:226:50:226:57 | source() | test.js:226:50:226:57 | source() |
|
||||
isSink
|
||||
| test.js:54:18:54:25 | source() | test-sink |
|
||||
| test.js:55:22:55:29 | source() | test-sink |
|
||||
@@ -119,6 +123,11 @@ isSink
|
||||
| test.js:207:24:207:31 | source() | test-sink |
|
||||
| test.js:208:24:208:31 | source() | test-sink |
|
||||
| test.js:211:34:211:41 | source() | test-sink |
|
||||
| test.js:214:34:214:41 | source() | test-sink |
|
||||
| test.js:222:52:222:52 | 0 | test-sink |
|
||||
| test.js:223:45:223:52 | source() | test-sink |
|
||||
| test.js:225:39:225:46 | source() | test-sink |
|
||||
| test.js:226:50:226:57 | source() | test-sink |
|
||||
syntaxErrors
|
||||
| Member[foo |
|
||||
| Member[foo] .Member[bar] |
|
||||
|
||||
@@ -209,3 +209,21 @@ testlib.bar.memberSink(source()); // NOT OK
|
||||
testlib.memberSink(source()); // OK
|
||||
testlib.overloadedSink('safe', source()); // OK
|
||||
testlib.overloadedSink('danger', source()); // NOT OK
|
||||
|
||||
function typeVars() {
|
||||
testlib.typevar.a.b().c.mySink(source()); // NOT OK
|
||||
|
||||
testlib.typevar.mySink(source()); // OK - does not match sub path
|
||||
testlib.typevar.a.mySink(source()); // OK - does not match sub path
|
||||
testlib.typevar.a.b.mySink(source()); // OK - does not match sub path
|
||||
testlib.typevar.a.b.c.mySink(source()); // OK - does not match sub path
|
||||
testlib.typevar.a.b(1).c.mySink(source()); // OK - does not match sub path
|
||||
|
||||
testlib.typevar.a.b().c.a.b().c.mySink(source(), 0); // OK
|
||||
testlib.typevar.a.b().c.a.b().c.mySink(0, source()); // NOT OK
|
||||
|
||||
testlib.typevar.left.x.right.mySink(source()); // NOT OK
|
||||
testlib.typevar.left.left.x.right.right.mySink(source()); // NOT OK
|
||||
testlib.typevar.left.x.right.right.mySink(source()); // OK - mismatched left and right
|
||||
testlib.typevar.left.left.x.right.mySink(source()); // OK - mismatched left and right
|
||||
}
|
||||
|
||||
@@ -40,6 +40,20 @@ class Sinks extends ModelInput::SinkModelCsv {
|
||||
"testlib;;Member[ParamDecoratorSink].DecoratedParameter;test-sink",
|
||||
"testlib;;AnyMember.Member[memberSink].Argument[0];test-sink",
|
||||
"testlib;;Member[overloadedSink].WithStringArgument[0=danger].Argument[1];test-sink",
|
||||
"testlib;;Member[typevar].TypeVar[ABC].Member[mySink].Argument[0];test-sink",
|
||||
"testlib;;Member[typevar].TypeVar[ABC].TypeVar[ABC].Member[mySink].Argument[1];test-sink",
|
||||
"testlib;;Member[typevar].TypeVar[LeftRight].Member[mySink].Argument[0];test-sink",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
class TypeVars extends ModelInput::TypeVariableModelCsv {
|
||||
override predicate row(string row) {
|
||||
row =
|
||||
[
|
||||
"ABC;Member[a].Member[b].WithArity[0].ReturnValue.Member[c]", //
|
||||
"LeftRight;Member[left].TypeVar[LeftRight].Member[right]", //
|
||||
"LeftRight;Member[x]",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user