From 947e9a5c31fe8884e570849f42df6e9390e2649d Mon Sep 17 00:00:00 2001 From: Scott Olson Date: Sat, 11 Jun 2016 12:38:50 -0600 Subject: [PATCH] Fix infinite loop when debug trace is disabled. --- src/bin/miri.rs | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/bin/miri.rs b/src/bin/miri.rs index 123428bcad1..b42c40031fd 100644 --- a/src/bin/miri.rs +++ b/src/bin/miri.rs @@ -66,21 +66,22 @@ fn interpret_start_points<'a, 'tcx>( ecx.push_stack_frame(tcx.map.local_def_id(id), mir.span, CachedMir::Ref(mir), substs, return_ptr); loop { - match (step(&mut ecx), return_ptr) { - (Ok(true), _) => {}, - (Ok(false), Some(ptr)) => if log_enabled!(::log::LogLevel::Debug) { - ecx.memory().dump(ptr.alloc_id); + match step(&mut ecx) { + Ok(true) => {} + Ok(false) => { + match return_ptr { + Some(ptr) => if log_enabled!(::log::LogLevel::Debug) { + ecx.memory().dump(ptr.alloc_id); + }, + None => warn!("diverging function returned"), + } break; - }, - (Ok(false), None) => { - warn!("diverging function returned"); - break; - }, + } // FIXME: diverging functions can end up here in some future miri - (Err(e), _) => { + Err(e) => { report(tcx, &ecx, e); break; - }, + } } } } -- 2.44.0