diff options
| author | Miquel Sabaté Solà <mssola@mssola.com> | 2026-08-25 07:36:54 +0200 |
|---|---|---|
| committer | Miquel Sabaté Solà <mssola@mssola.com> | 2026-08-25 17:48:40 +0200 |
| commit | 26d7442da849373edffffa350d655abc2a009d62 (patch) | |
| tree | 737d924a4f683d6ca1a407d99026a1fcbe733058 /lib/vnf | |
| parent | f6f78b2f14a68a4a187b652c3aa914877a8d2394 (diff) | |
| download | tools.nes-26d7442da849373edffffa350d655abc2a009d62.tar.gz tools.nes-26d7442da849373edffffa350d655abc2a009d62.zip | |
Stop execution if not active in until_address()
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>
Diffstat (limited to 'lib/vnf')
| -rw-r--r-- | lib/vnf/src/lib.rs | 2 |
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()?; } |
