From b36d8085a753e243728ec67fa8af3f925656a5fe Mon Sep 17 00:00:00 2001 From: Scott Olson Date: Mon, 6 Feb 2017 09:26:01 -0800 Subject: [PATCH] Fix duplicate allocation printing. --- src/eval_context.rs | 2 +- src/memory.rs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/eval_context.rs b/src/eval_context.rs index a64b3fc3548c..21f71933d238 100644 --- a/src/eval_context.rs +++ b/src/eval_context.rs @@ -200,7 +200,7 @@ pub(super) fn const_to_value(&mut self, const_val: &ConstVal) -> EvalResult<'tcx Struct(_) => unimplemented!(), Tuple(_) => unimplemented!(), Function(_) => unimplemented!(), - Array(_) => unimplemented!(), + Array(_) => unimplemented!(), Repeat(_, _) => unimplemented!(), }; diff --git a/src/memory.rs b/src/memory.rs index 8df4940c113e..e9748ba62c78 100644 --- a/src/memory.rs +++ b/src/memory.rs @@ -411,7 +411,6 @@ pub fn dump_allocs(&self, mut allocs: Vec) { let mut allocs_seen = HashSet::new(); while let Some(id) = allocs_to_print.pop_front() { - allocs_seen.insert(id); if id == ZST_ALLOC_ID || id == NEVER_ALLOC_ID { continue; } let mut msg = format!("Alloc {:<5} ", format!("{}:", id)); let prefix_len = msg.len(); @@ -433,7 +432,7 @@ pub fn dump_allocs(&self, mut allocs: Vec) { for i in 0..(alloc.bytes.len() as u64) { if let Some(&target_id) = alloc.relocations.get(&i) { - if !allocs_seen.contains(&target_id) { + if allocs_seen.insert(target_id) { allocs_to_print.push_back(target_id); } relocations.push((i, target_id));