mirror of
https://github.com/github/codeql.git
synced 2026-05-01 11:45:14 +02:00
JS: Fix bad join order in PropertyProjection
This commit is contained in:
@@ -75,10 +75,6 @@ private DataFlow::SourceNode getASimplePropertyProjectionCallee(
|
||||
) {
|
||||
singleton = false and
|
||||
(
|
||||
result = LodashUnderscore::member("pick") and
|
||||
objectIndex = 0 and
|
||||
selectorIndex = [1 .. max(result.getACall().getNumArgument())]
|
||||
or
|
||||
result = LodashUnderscore::member("pickBy") and
|
||||
objectIndex = 0 and
|
||||
selectorIndex = 1
|
||||
@@ -131,6 +127,19 @@ private class SimplePropertyProjection extends PropertyProjection::Range {
|
||||
override predicate isSingletonProjection() { singleton = true }
|
||||
}
|
||||
|
||||
/**
|
||||
* A property projection with a variable number of selector indices.
|
||||
*/
|
||||
private class VarArgsPropertyProjection extends PropertyProjection::Range {
|
||||
VarArgsPropertyProjection() { this = LodashUnderscore::member("pick").getACall() }
|
||||
|
||||
override DataFlow::Node getObject() { result = getArgument(0) }
|
||||
|
||||
override DataFlow::Node getASelector() { result = getArgument(any(int i | i > 0)) }
|
||||
|
||||
override predicate isSingletonProjection() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* A taint step for a property projection.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user