aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-08-25 07:36:54 +0200
committerMiquel Sabaté Solà <mssola@mssola.com>2026-08-25 07:36:54 +0200
commit765f66e909fbfe4b9182e61a08c5078112c5b1a8 (patch)
treeeadcb306d840422e0896888b0b25f5869e0a553b
parent2177745a72de06285f71df03f7678dfc82bfb01d (diff)
downloadtools.nes-main.tar.gz
tools.nes-main.zip
Stop execution if not active in until_address()HEADmain
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à <mssola@mssola.com>
-rw-r--r--lib/vnf/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
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()?;
}