Skip to content

Commit 1c8f474

Browse files
committed
C++: Add comment as suggested in the PR review for #14708.
1 parent 2787f0a commit 1c8f474

File tree

1 file changed

+6
-0
lines changed
  • cpp/ql/test/library-tests/ir/range-analysis

1 file changed

+6
-0
lines changed

cpp/ql/test/library-tests/ir/range-analysis/test.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ void test_div(int x) {
134134
struct X { int n; };
135135
void read_argument(const X *);
136136

137+
// This test exists purely to ensure that modulus analysis terminates in the
138+
// presence of inexact phi operands. The LoadInstruction on `while(x->n) { ... }`
139+
// reads from a PhiInstruction with two input operands: an exact operand defined
140+
// by the StoreInstruction generated by `x->n--` and an inexact operand coming
141+
// from the WriteSideEffect generated by `read_argument(x)`. If we don't consider
142+
// the inexact operand modulus analysis fails to terminate.
137143
void nonterminating_without_operands_as_ssa(X *x) {
138144
read_argument(x);
139145
while (x->n) {

0 commit comments

Comments
 (0)