Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 252e1c7

Browse files
authored
Merge pull request #2313 from erik-krogh/quickFixreflectiveCallNode
Approved by max-schaefer
2 parents 46bc804 + 538690e commit 252e1c7

2 files changed

Lines changed: 2 additions & 19 deletions

File tree

javascript/ql/src/semmle/javascript/dataflow/Configuration.qll

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ abstract class BarrierGuardNode extends DataFlow::Node {
308308
exists(SsaRefinementNode ref, boolean outcome |
309309
nd = DataFlow::ssaDefinitionNode(ref) and
310310
forex(SsaVariable input | input = ref.getAnInput() |
311-
getExpr() = ref.getGuard().getTest() and
311+
getEnclosingExpr() = ref.getGuard().getTest() and
312312
outcome = ref.getGuard().(ConditionGuardNode).getOutcome() and
313313
barrierGuardBlocksExpr(this, outcome, input.getAUse(), label)
314314
)
@@ -317,20 +317,13 @@ abstract class BarrierGuardNode extends DataFlow::Node {
317317
// 2) `nd` is an instance of an access path `p`, and dominated by a barrier for `p`
318318
exists(AccessPath p, BasicBlock bb, ConditionGuardNode cond, boolean outcome |
319319
nd = DataFlow::valueNode(p.getAnInstanceIn(bb)) and
320-
getExpr() = cond.getTest() and
320+
getEnclosingExpr() = cond.getTest() and
321321
outcome = cond.getOutcome() and
322322
barrierGuardBlocksAccessPath(this, outcome, p, label) and
323323
cond.dominates(bb)
324324
)
325325
}
326326

327-
/** Gets the corresponding expression, including that of reflective calls. */
328-
private Expr getExpr() {
329-
result = asExpr()
330-
or
331-
this = DataFlow::reflectiveCallNode(result)
332-
}
333-
334327
/**
335328
* Holds if this node blocks expression `e` provided it evaluates to `outcome`.
336329
*

javascript/ql/src/semmle/javascript/dataflow/DataFlow.qll

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -996,16 +996,6 @@ module DataFlow {
996996
*/
997997
DataFlow::Node globalAccessPathRootPseudoNode() { result instanceof TGlobalAccessPathRoot }
998998

999-
/**
1000-
* Gets a data flow node representing the underlying call performed by the given
1001-
* call to `Function.prototype.call` or `Function.prototype.apply`.
1002-
*
1003-
* For example, for an expression `fn.call(x, y)`, this gets a call node with `fn` as the
1004-
* callee, `x` as the receiver, and `y` as the first argument.
1005-
*/
1006-
DataFlow::InvokeNode reflectiveCallNode(InvokeExpr expr) { result = TReflectiveCallNode(expr, _) }
1007-
1008-
1009999
/**
10101000
* Gets a data flow node representing the underlying call performed by the given
10111001
* call to `Function.prototype.call` or `Function.prototype.apply`.

0 commit comments

Comments
 (0)