Commit d6a9c734250e8966d53d704279c8c450354bf152
authorMichel Pollet <buserror@gmail.com>
Mon, 6 Feb 2017 08:33:02 +0000 (08:33 +0000)
committerMichel Pollet <buserror@gmail.com>
Wed, 15 Feb 2017 12:53:08 +0000 (12:53 +0000)
Manage to bite myself on this one.

Signed-off-by: Michel Pollet <buserror@gmail.com>
simavr/sim/sim_cmds.c

index bb5f3087bae43074c171f581f2de8697239401c6..587f259e1503734cf896e922cb70aa9adec4ffc4 100644 (file)
@@ -51,6 +51,12 @@ _avr_cmd_io_write(
                }
                command = &commands->table[v];
        }
+       if (!command->handler) {
+               AVR_LOG(avr, LOG_ERROR, LOG_PREFIX
+                       "%s: code 0x%02x has no handler (wrong MMCU config)\n",
+                       __FUNCTION__, v);
+               return;
+       }
 
        if (command) {
                if (command->handler(avr, v, command->param))