mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
JS: replace .stripParens query uses w. .getUnderlyingReference
This commit is contained in:
@@ -26,7 +26,7 @@ class IncrementExpr extends Expr {
|
||||
// x = x + e
|
||||
exists (AssignExpr assgn, Variable v | assgn = this |
|
||||
assgn.getTarget() = v.getAnAccess() and
|
||||
assgn.getRhs().(AddExpr).getAnOperand().stripParens() = v.getAnAccess()
|
||||
assgn.getRhs().(AddExpr).getAnOperand().getUnderlyingReference() = v.getAnAccess()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ import semmle.javascript.dataflow.Refinements
|
||||
*/
|
||||
predicate isDefensiveInit(VarAccess va) {
|
||||
exists (LogOrExpr o, VarRef va2 |
|
||||
va = o.getLeftOperand().stripParens() and va2.getVariable() = va.getVariable() |
|
||||
va = o.getLeftOperand().getUnderlyingReference() and va2.getVariable() = va.getVariable() |
|
||||
exists (AssignExpr assgn | va2 = assgn.getTarget() |
|
||||
assgn = o.getRightOperand().stripParens() or
|
||||
o = assgn.getRhs().getUnderlyingValue()
|
||||
|
||||
Reference in New Issue
Block a user