Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 971456c commit 952dbd6Copy full SHA for 952dbd6
1 file changed
cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaInternalsCommon.qll
@@ -117,6 +117,16 @@ private int countIndirections(Type t) {
117
else (
118
result = any(Indirection ind | ind.getType() = t).getNumberOfIndirections()
119
or
120
+ // If there is an indirection for the type, but we cannot count the number of indirections
121
+ // it means we couldn't reach a non-indirection type by stripping off indirections. This
122
+ // can occur if an iterator specifies itself as the value type. In this case we default to
123
+ // 1 indirection fore the type.
124
+ exists(Indirection ind |
125
+ ind.getType() = t and
126
+ not exists(ind.getNumberOfIndirections()) and
127
+ result = 1
128
+ )
129
+ or
130
not exists(Indirection ind | ind.getType() = t) and
131
result = 0
132
)
0 commit comments