@@ -148,14 +148,14 @@ type EvalSnapshot<'a, 'mir, 'tcx, M>
148
148
pub ( crate ) struct InfiniteLoopDetector < ' a , ' mir , ' tcx : ' a + ' mir , M : Machine < ' mir , ' tcx > > {
149
149
/// The set of all `EvalSnapshot` *hashes* observed by this detector.
150
150
///
151
- /// Not a proper bloom filter .
152
- bloom : FxHashSet < u64 > ,
151
+ /// When a collision occurs in this table, we store the full snapshot in `snapshots` .
152
+ hashes : FxHashSet < u64 > ,
153
153
154
154
/// The set of all `EvalSnapshot`s observed by this detector.
155
155
///
156
- /// An `EvalSnapshot` will only be fully cloned once it has caused a collision
157
- /// in `bloom`. As a result, the detector must observe *two* full cycles of
158
- /// an infinite loop before it triggers.
156
+ /// An `EvalSnapshot` will only be fully cloned once it has caused a collision in `hashes`. As
157
+ /// a result, the detector must observe at least *two* full cycles of an infinite loop before
158
+ /// it triggers.
159
159
snapshots : FxHashSet < EvalSnapshot < ' a , ' mir , ' tcx , M > > ,
160
160
}
161
161
@@ -165,7 +165,7 @@ impl<'a, 'mir, 'tcx, M> Default for InfiniteLoopDetector<'a, 'mir, 'tcx, M>
165
165
{
166
166
fn default ( ) -> Self {
167
167
InfiniteLoopDetector {
168
- bloom : FxHashSet :: default ( ) ,
168
+ hashes : FxHashSet :: default ( ) ,
169
169
snapshots : FxHashSet :: default ( ) ,
170
170
}
171
171
}
@@ -177,7 +177,7 @@ impl<'a, 'mir, 'tcx, M> InfiniteLoopDetector<'a, 'mir, 'tcx, M>
177
177
{
178
178
/// Returns `true` if the loop detector has not yet observed a snapshot.
179
179
pub fn is_empty ( & self ) -> bool {
180
- self . bloom . is_empty ( )
180
+ self . hashes . is_empty ( )
181
181
}
182
182
183
183
pub fn observe_and_analyze (
@@ -192,7 +192,7 @@ impl<'a, 'mir, 'tcx, M> InfiniteLoopDetector<'a, 'mir, 'tcx, M>
192
192
snapshot. hash ( & mut fx) ;
193
193
let hash = fx. finish ( ) ;
194
194
195
- if self . bloom . insert ( hash) {
195
+ if self . hashes . insert ( hash) {
196
196
// No collision
197
197
return Ok ( ( ) )
198
198
}
0 commit comments