Skip to content

Commit 3822d14

Browse files
committed
SSA: Elaborate qldoc.
1 parent 53557db commit 3822d14

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

shared/ssa/codeql/ssa/Ssa.qll

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,14 @@ module Make<LocationSig Location, InputSig<Location> Input> {
189189
/**
190190
* Gets the (1-based) rank of the first reference to `v` inside basic block `bb`
191191
* that is either a read or a certain write.
192+
*
193+
* Note that uncertain writes have no impact on liveness: a variable is
194+
* live before an uncertain write if and only if it is live after.
195+
* The reference identified here therefore determines liveness at the
196+
* beginning of `bb`: if it is a read then the variable is live and if it
197+
* is a write then it is not. For basic blocks without reads or certain
198+
* writes, liveness at the beginning of the block is equivalent to liveness
199+
* at the end of the block.
192200
*/
193201
private int firstReadOrCertainWrite(BasicBlock bb, SourceVariable v) {
194202
result =

0 commit comments

Comments
 (0)