Skip to content

Commit 860b257

Browse files
committed
Don't hash the ctfe memory
1 parent 4a89558 commit 860b257

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustc_mir/interpret/eval_context.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,10 @@ impl<'a, 'mir, 'tcx, M> InfiniteLoopDetector<'a, 'mir, 'tcx, M>
214214
stack: &Vec<Frame<'mir, 'tcx>>,
215215
memory: &Memory<'a, 'mir, 'tcx, M>,
216216
) -> EvalResult<'tcx, ()> {
217-
let snapshot = (machine, stack, memory);
218-
219217
let mut fx = FxHasher::default();
220-
snapshot.hash(&mut fx);
218+
// don't hash the memory, that takes too much time, just compare when you hit a collision
219+
// should be rare enough
220+
(machine, stack).hash(&mut fx);
221221
let hash = fx.finish();
222222

223223
if self.hashes.insert(hash) {

0 commit comments

Comments
 (0)