Skip to content

Commit

Permalink
C++: Add comment as suggested in the PR review for #14708.
Browse files Browse the repository at this point in the history
  • Loading branch information
MathiasVP committed Nov 7, 2023
1 parent 2787f0a commit 1c8f474
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cpp/ql/test/library-tests/ir/range-analysis/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ void test_div(int x) {
struct X { int n; };
void read_argument(const X *);

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

0 comments on commit 1c8f474

Please sign in to comment.