Fix duplicate allocation printing.

This commit is contained in:
Scott Olson
2017-02-06 09:26:01 -08:00
parent 7acbf7ef74
commit b36d8085a7
2 changed files with 2 additions and 3 deletions
+1 -1
View File
@@ -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!(),
};
+1 -2
View File
@@ -411,7 +411,6 @@ pub fn dump_allocs(&self, mut allocs: Vec<AllocId>) {
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<AllocId>) {
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));