From d6a9c734250e8966d53d704279c8c450354bf152 Mon Sep 17 00:00:00 2001 From: Michel Pollet Date: Mon, 6 Feb 2017 08:33:02 +0000 Subject: [PATCH] Added sanity check for the .mmcu section handlers Manage to bite myself on this one. Signed-off-by: Michel Pollet --- simavr/sim/sim_cmds.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/simavr/sim/sim_cmds.c b/simavr/sim/sim_cmds.c index bb5f308..587f259 100644 --- a/simavr/sim/sim_cmds.c +++ b/simavr/sim/sim_cmds.c @@ -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)) -- 2.39.5