summaryrefslogtreecommitdiffstats
path: root/src/librustc_mir/interpret/step.rs
diff options
context:
space:
mode:
authorOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>2018-02-19 12:00:15 +0100
committerOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>2018-03-08 08:34:17 +0100
commit0ca4b45a0ccf9e29a17f0613fb280411910b3dbd (patch)
treeefda0594270350b46d8db611e6f89cda786ba8ac /src/librustc_mir/interpret/step.rs
parentAdd regression test (diff)
downloadgrust-0ca4b45a0ccf9e29a17f0613fb280411910b3dbd.tar.gz
grust-0ca4b45a0ccf9e29a17f0613fb280411910b3dbd.tar.bz2
grust-0ca4b45a0ccf9e29a17f0613fb280411910b3dbd.tar.xz
Step limit is now terminator limit
Diffstat (limited to 'src/librustc_mir/interpret/step.rs')
-rw-r--r--src/librustc_mir/interpret/step.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/librustc_mir/interpret/step.rs b/src/librustc_mir/interpret/step.rs
index 54fd364d3f..4e1750caf2 100644
--- a/src/librustc_mir/interpret/step.rs
+++ b/src/librustc_mir/interpret/step.rs
@@ -19,7 +19,6 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
19 19
20 /// Returns true as long as there are more things to do. 20 /// Returns true as long as there are more things to do.
21 pub fn step(&mut self) -> EvalResult<'tcx, bool> { 21 pub fn step(&mut self) -> EvalResult<'tcx, bool> {
22 self.inc_step_counter_and_check_limit(1)?;
23 if self.stack.is_empty() { 22 if self.stack.is_empty() {
24 return Ok(false); 23 return Ok(false);
25 } 24 }
@@ -37,6 +36,8 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
37 return Ok(true); 36 return Ok(true);
38 } 37 }
39 38
39 self.inc_step_counter_and_check_limit(1)?;
40
40 let terminator = basic_block.terminator(); 41 let terminator = basic_block.terminator();
41 assert_eq!(old_frames, self.cur_frame()); 42 assert_eq!(old_frames, self.cur_frame());
42 self.terminator(terminator)?; 43 self.terminator(terminator)?;