JS: fixup: use the basic block of the actual write (ODASA-7636)

This commit is contained in:
Esben Sparre Andreasen
2019-01-10 15:19:08 +01:00
parent 9219214d64
commit d3543b74c0
2 changed files with 14 additions and 4 deletions

View File

@@ -78,10 +78,8 @@ predicate isDeadAssignment(string name, DataFlow::PropWrite assign1, DataFlow::P
*/
bindingset[name]
predicate maybeAccessesAssignedPropInBlock(string name, DataFlow::PropWrite assign, boolean after) {
exists(ControlFlowNode write, ReachableBasicBlock block, int i, int j, Expr e |
write = assign.getWriteNode() and
block = assign.getBasicBlock() and
write = block.getNode(i) and
exists(ReachableBasicBlock block, int i, int j, Expr e |
assign.getWriteNode() = block.getNode(i) and
e = block.getNode(j) and
maybeAccessesProperty(e, name)
|