X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=simavr%2Fsim%2Fsim_io.c;h=7edb7865580a9a3bdca7b0978e6f6437b5445382;hb=58506fe0240ff2902e9fb740cab6df80e1436baa;hp=2fa455be6dc214a14009c93ece3747f47982e155;hpb=82f36e2c5b3436a12499b7d8ca3b09f0e0ab1b85;p=simavr diff --git a/simavr/sim/sim_io.c b/simavr/sim/sim_io.c index 2fa455b..7edb786 100644 --- a/simavr/sim/sim_io.c +++ b/simavr/sim/sim_io.c @@ -99,6 +99,12 @@ avr_register_io_write( { avr_io_addr_t a = AVR_DATA_TO_IO(addr); + if (a >= MAX_IOs) { + fprintf(stderr, + "Error: avr_register_io_write(): IO address 0x%04x out of range (max 0x%04x).\n", + a, MAX_IOs); + abort(); + } /* * Verifying that some other piece of code is not installed to watch write * on this address. If there is, this code installs a "dispatcher" callback