Skip to content

Commit 2e94b09

Browse files
committed
Address review comments
1 parent 8e26fa1 commit 2e94b09

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

go/ql/lib/semmle/go/dataflow/GlobalValueNumbering.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ private predicate iDomEffect(
138138
* dominator of `node` and no side-effects can occur between `result` and
139139
* `node`.
140140
*
141+
* `entry` is the entry node for the function containing `node` and `result`.
142+
*
141143
* `sideEffectCFG` has an edge from the function entry to every node with a
142144
* side-effect. This means that every node with a side-effect has the
143145
* function entry as its immediate dominator. So if node `x` dominates node
@@ -181,6 +183,10 @@ private predicate iDomEffect(
181183
*
182184
* The immediate dominator path to line 015 is 000 - 009 - 012 - 015.
183185
* Therefore, the most recent side effect for line 015 is line 009.
186+
* (Note that line 009 is not a side-effect itself. Instead, it is the
187+
* point where the control flow paths from the side-effects at 004 and 007
188+
* merge. Because its immediate dominator is the entry node 000, it serves
189+
* as the safe root for expressions evaluated after those side-effects.)
184190
*/
185191
private ControlFlow::Node mostRecentSideEffect(ControlFlow::Node entry, ControlFlow::Node node) {
186192
iDomEffect(entry, entry, result) and

0 commit comments

Comments
 (0)