We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a3a3423 commit 027f22dCopy full SHA for 027f22d
cpp/ql/test/library-tests/rangeanalysis/SimpleRangeAnalysis/test.cpp
@@ -78,3 +78,25 @@ void use_after_cast(unsigned char c)
78
}
79
c_times_2;
80
81
+
82
+int ref_to_number(int &i, const int &ci, int &aliased) {
83
+ int &alias = aliased; // no range analysis for either of the two aliased variables
84
85
+ if (i >= 2)
86
+ return i; // BUG: lower bound should be 2
87
88
+ if (ci >= 2)
89
+ return ci; // BUG: lower bound should be 2
90
91
+ if (aliased >= 2)
92
+ return aliased;
93
94
+ if (alias >= 2)
95
+ return alias;
96
97
+ for (; i <= 12345; i++) {
98
+ i; // BUG: upper bound should be deduced (but subject to widening)
99
+ }
100
101
+ return 0;
102
+}
0 commit comments