@@ -141,10 +141,12 @@ private class IteratorCrementNonMemberOperatorModel extends IteratorCrementNonMe
141
141
}
142
142
143
143
override predicate hasSpecificWriteSideEffect ( ParameterIndex i , boolean buffer , boolean mustWrite ) {
144
- // `buffer` must be `true` or `mustWrite` must be `false` to ensure that
145
- // the IR alias analysis doesn't think that `it++` doesn't completely override
146
- // the value of the iterator. Ideally, the IR alias analysis shouldn't deal with
147
- // iterators, but this is necessary for taintflow to get any results in our iterator tests.
144
+ // We have two choices here: either `buffer` must be `true` or `mustWrite`
145
+ // must be `false` to ensure that the IR alias analysis doesn't think that
146
+ // `it++` completely override the value of the iterator.
147
+ // We choose `mustWrite` must be `false`. In that case, the value of
148
+ // `buffer` isn't super important (it just decides which kind of read side
149
+ // effect will be emitted).
148
150
i = 0 and buffer = false and mustWrite = false
149
151
}
150
152
@@ -193,10 +195,12 @@ private class IteratorCrementMemberOperatorModel extends IteratorCrementMemberOp
193
195
}
194
196
195
197
override predicate hasSpecificWriteSideEffect ( ParameterIndex i , boolean buffer , boolean mustWrite ) {
196
- // `buffer` must be `true` or `mustWrite` must be `false` to ensure that
197
- // the IR alias analysis doesn't think that `it++` doesn't completely override
198
- // the value of the iterator. Ideally, the IR alias analysis shouldn't deal with
199
- // iterators, but this is necessary for taintflow to get any results in our iterator tests.
198
+ // We have two choices here: either `buffer` must be `true` or `mustWrite`
199
+ // must be `false` to ensure that the IR alias analysis doesn't think that
200
+ // `it++` completely override the value of the iterator.
201
+ // We choose `mustWrite` must be `false`. In that case, the value of
202
+ // `buffer` isn't super important (it just decides which kind of read side
203
+ // effect will be emitted).
200
204
i = - 1 and buffer = false and mustWrite = false
201
205
}
202
206
0 commit comments