Skip to content

Commit

Permalink
Don't hash the ctfe memory
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Aug 30, 2018
1 parent 4a89558 commit 860b257
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/librustc_mir/interpret/eval_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,10 @@ impl<'a, 'mir, 'tcx, M> InfiniteLoopDetector<'a, 'mir, 'tcx, M>
stack: &Vec<Frame<'mir, 'tcx>>,
memory: &Memory<'a, 'mir, 'tcx, M>,
) -> EvalResult<'tcx, ()> {
let snapshot = (machine, stack, memory);

let mut fx = FxHasher::default();
snapshot.hash(&mut fx);
// don't hash the memory, that takes too much time, just compare when you hit a collision
// should be rare enough
(machine, stack).hash(&mut fx);
let hash = fx.finish();

if self.hashes.insert(hash) {
Expand Down

0 comments on commit 860b257

Please sign in to comment.