Skip to content

Commit 374b1b7

Browse files
committed
apply manual magic in both cases in maybeAssignsAccessedPropInBlock
1 parent eccfade commit 374b1b7

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

javascript/ql/src/Declarations/DeadStoreOfProperty.ql

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -115,20 +115,22 @@ predicate maybeAssignsAccessedPropInBlock(DataFlow::PropWrite assign, boolean af
115115
or
116116
after = false and postDominatedPropWrite(_, _, assign, false)
117117
) and
118-
exists(ReachableBasicBlock block, int i, int j, Expr e, string name |
119-
i = getRank(block, assign.getWriteNode(), name) and
120-
j = getRank(block, e, name) and
121-
isAPropertyRead(e, name)
122-
|
123-
after = true and i < j
124-
or
125-
after = false and j < i
126-
)
127-
or
128-
exists(ReachableBasicBlock block | assign.getWriteNode().getBasicBlock() = block |
129-
after = true and isBeforeImpure(assign, block)
118+
(
119+
exists(ReachableBasicBlock block, int i, int j, Expr e, string name |
120+
i = getRank(block, assign.getWriteNode(), name) and
121+
j = getRank(block, e, name) and
122+
isAPropertyRead(e, name)
123+
|
124+
after = true and i < j
125+
or
126+
after = false and j < i
127+
)
130128
or
131-
after = false and isAfterImpure(assign, block)
129+
exists(ReachableBasicBlock block | assign.getWriteNode().getBasicBlock() = block |
130+
after = true and isBeforeImpure(assign, block)
131+
or
132+
after = false and isAfterImpure(assign, block)
133+
)
132134
)
133135
}
134136

0 commit comments

Comments
 (0)