From: nnayo Date: Wed, 12 Feb 2014 10:14:51 +0000 (+0100) Subject: correct a segfault X-Git-Tag: v1.2~35^2 X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=c898381059b0ffee9d14e7cb634226a3b3ec8d2c;p=sx%2Fsimavr.git correct a segfault --- diff --git a/simavr/sim/sim_elf.c b/simavr/sim/sim_elf.c index 68fe2e2..a0a49ee 100644 --- a/simavr/sim/sim_elf.c +++ b/simavr/sim/sim_elf.c @@ -57,7 +57,7 @@ void avr_load_firmware(avr_t * avr, elf_firmware_t * firmware) memset(avr->trace_data->codeline, 0, scount * sizeof(avr_symbol_t*)); for (int i = 0; i < firmware->symbolcount; i++) - if (!(firmware->symbol[i]->addr >> 20)) // code address + if (firmware->symbol[i]->addr < firmware->flashsize) // code address avr->trace_data->codeline[firmware->symbol[i]->addr >> 1] = firmware->symbol[i]; // "spread" the pointers for known symbols forward