From 7843a244b00d291c2a0f4a480847642cb1b49129 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Fri, 28 Oct 2016 22:23:25 -0400 Subject: [PATCH] Ensured emulation doesn't enter an infinite loop if the user attempts to read beyond the end of a tape. --- Machines/Electron/Electron.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Machines/Electron/Electron.cpp b/Machines/Electron/Electron.cpp index 69917f4f6..89f654eb9 100644 --- a/Machines/Electron/Electron.cpp +++ b/Machines/Electron/Electron.cpp @@ -365,7 +365,7 @@ unsigned int Machine::perform_bus_operation(CPU6502::BusOperation operation, uin int cycles_left_while_plausibly_in_data = 50; _tape.clear_interrupts(Interrupt::ReceiveDataFull); - while(1) + while(!_tape.get_tape()->is_at_end()) { _tape.run_for_input_pulse(); cycles_left_while_plausibly_in_data--;