JS: avoid two uses of getChildExpr(0)

This commit is contained in:
Esben Sparre Andreasen
2018-11-05 11:34:34 +01:00
parent 15123da0b7
commit 3aae1d17db

View File

@@ -239,10 +239,11 @@ module Internal {
op.getRightOperand() = result
)
or
exists(IfStmt c |
c.getCondition() = guard |
result = c.getAControlledStmt().getChildExpr(0) or
result = c.getAControlledStmt().(BlockStmt).getStmt(0).getChildExpr(0)
exists(IfStmt c, ExprStmt guardedStmt |
c.getCondition() = guard and
result = guardedStmt.getExpr() |
guardedStmt = c.getAControlledStmt() or
guardedStmt = c.getAControlledStmt().(BlockStmt).getStmt(0)
)
or
exists (ConditionalExpr c |