mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
Merge pull request #354 from DrDoof/fix/isolate-cpu-port
port: reject the CPU port in isolate instead of refusing it silently
This commit is contained in:
+5
-5
@@ -428,11 +428,11 @@ void parse_isolate(void)
|
|||||||
|
|
||||||
print_string("\nISOLATE ");
|
print_string("\nISOLATE ");
|
||||||
|
|
||||||
__xdata int8_t port_configured = cmd_buffer[cmd_words_b[1]] - '1';
|
if (!isnumber(cmd_buffer[cmd_words_b[1]]) || cmd_buffer[cmd_words_b[1]] == '0'
|
||||||
port_configured = machine.phys_to_log_port[port_configured];
|
|| isnumber(cmd_buffer[cmd_words_b[1] + 1]))
|
||||||
if (isnumber(cmd_buffer[cmd_words_b[1] + 1])) // CPU-port, logical port 9
|
goto err;
|
||||||
port_configured = (port_configured + 1) * 10 + cmd_buffer[cmd_words_b[1] + 1] - '1';
|
__xdata uint8_t port_configured = machine.phys_to_log_port[cmd_buffer[cmd_words_b[1]] - '1'];
|
||||||
if (port_configured < 0 || port_configured > 9)
|
if (port_configured < machine.min_port || port_configured > machine.max_port)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
print_byte(port_configured); write_char('\n');
|
print_byte(port_configured); write_char('\n');
|
||||||
|
|||||||
Reference in New Issue
Block a user