We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2787f0a commit 1c8f474Copy full SHA for 1c8f474
1 file changed
cpp/ql/test/library-tests/ir/range-analysis/test.cpp
@@ -134,6 +134,12 @@ void test_div(int x) {
134
struct X { int n; };
135
void read_argument(const X *);
136
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.
143
void nonterminating_without_operands_as_ssa(X *x) {
144
read_argument(x);
145
while (x->n) {
0 commit comments