From 765f66e909fbfe4b9182e61a08c5078112c5b1a8 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Tue, 25 Aug 2026 07:36:54 +0200 Subject: Stop execution if not active in until_address() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Even if the desired thing is to run until the provided address is reached, abort execution as well if the machine stops being active as well. This is a common scenario when running in function mode and the target end address is something passed that. Fixes: e6c41303c2da ("runrom: add the --until-address option") Signed-off-by: Miquel Sabaté Solà --- lib/vnf/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/vnf') diff --git a/lib/vnf/src/lib.rs b/lib/vnf/src/lib.rs index 349548a..fc170f5 100644 --- a/lib/vnf/src/lib.rs +++ b/lib/vnf/src/lib.rs @@ -556,7 +556,7 @@ impl Machine { /// Run until the program counter reaches the given 'address'. pub fn until_address(&mut self, address: u16) -> Result<(), String> { - while self.pc != address as usize { + while self.pc != address as usize && self.active { self.next_iteration()?; } -- cgit v1.2.3