From 4ad3ec7da3ec6eab2dd54f7dbbbae8d9b62d57d3 Mon Sep 17 00:00:00 2001 From: Michael Benfield Date: Thu, 14 Nov 2024 14:33:48 -0800 Subject: [PATCH] check for empty frames --- interpreter/src/cursor.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/interpreter/src/cursor.rs b/interpreter/src/cursor.rs index 223d7a11c1..0f66ceaa11 100644 --- a/interpreter/src/cursor.rs +++ b/interpreter/src/cursor.rs @@ -2377,6 +2377,10 @@ impl<'a> Cursor<'a> { /// stack. Once that has executed and we've returned to the conditional, the final step /// does nothing. pub fn step(&mut self) -> Result { + if self.frames.is_empty() { + halt!("no execution frames available"); + } + let Frame { element, step, user_initiated } = self.frames.last().expect("there should be a frame"); let user_initiated = *user_initiated; match element {