mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
JS: fix ql/field-only-used-in-charpred within JavaScript
This commit is contained in:
@@ -152,15 +152,12 @@ private module ArrayDataFlow {
|
||||
/**
|
||||
* A node that reads or writes an element from an array inside a for-loop.
|
||||
*/
|
||||
private class ArrayIndexingAccess extends DataFlow::Node {
|
||||
DataFlow::PropRef read;
|
||||
|
||||
private class ArrayIndexingAccess extends DataFlow::Node instanceof DataFlow::PropRef {
|
||||
ArrayIndexingAccess() {
|
||||
read = this and
|
||||
TTNumber() =
|
||||
unique(InferredType type | type = read.getPropertyNameExpr().flow().analyze().getAType()) and
|
||||
unique(InferredType type | type = super.getPropertyNameExpr().flow().analyze().getAType()) and
|
||||
exists(VarAccess i, ExprOrVarDecl init |
|
||||
i = read.getPropertyNameExpr() and init = any(ForStmt f).getInit()
|
||||
i = super.getPropertyNameExpr() and init = any(ForStmt f).getInit()
|
||||
|
|
||||
i.getVariable().getADefinition() = init or
|
||||
i.getVariable().getADefinition().(VariableDeclarator).getDeclStmt() = init
|
||||
|
||||
Reference in New Issue
Block a user