File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,16 @@ private int countIndirections(Type t) {
117
117
else (
118
118
result = any ( Indirection ind | ind .getType ( ) = t ) .getNumberOfIndirections ( )
119
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
120
130
not exists ( Indirection ind | ind .getType ( ) = t ) and
121
131
result = 0
122
132
)
You can’t perform that action at this time.
0 commit comments