From 164b29bab8477f7149762ef837e3fc52a5492e9c Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Tue, 25 Aug 2020 19:43:17 +0200 Subject: [PATCH] fixed crash in BASIC when trying to incorrectly execute operator --- src/basic/basic_commands/cmd__jumptable.s | 6 ++---- src/basic/engine_runtime/execute_line_statements.s | 3 +++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/basic/basic_commands/cmd__jumptable.s b/src/basic/basic_commands/cmd__jumptable.s index 321ebb31..3f541ef8 100644 --- a/src/basic/basic_commands/cmd__jumptable.s +++ b/src/basic/basic_commands/cmd__jumptable.s @@ -55,14 +55,12 @@ cmd_tab, // XXX this token probably does not belong here do_SYNTAX_error, // 'TO' is not a standalone command do_SYNTAX_error, // 'FN' is not a standalone command - cmd_spc, // XXX this token probably does not belong here + cmd_spc // XXX this token probably does not belong here // 'THEN' ($A7) and 'STEP' ($A9) are not standalone commands // 'NOT' ($A8) is an operator, not a command - // $CB, but remapped to $A7 - - cmd_go + // 'GO' ($CB) is handled separately ) diff --git a/src/basic/engine_runtime/execute_line_statements.s b/src/basic/engine_runtime/execute_line_statements.s index 9c637b07..dd1d3b99 100644 --- a/src/basic/engine_runtime/execute_line_statements.s +++ b/src/basic/engine_runtime/execute_line_statements.s @@ -61,6 +61,9 @@ execute_statements: cpx #$7F bcc_16 execute_statements_var_assign // not a token - try variable assign + cpx #$A7 + bcs_16 do_SYNTAX_error + #if !HAS_OPCODES_65C02 // Get the jump table entry for it, push it on the stack, and then RTS to start it.