Commit d2196da73575ab6fafce44ddbe817ae20b61e8c0
authorMichel Pollet <buserror@gmail.com>
Sun, 11 Apr 2010 18:38:24 +0000 (19:38 +0100)
committerMichel Pollet <buserror@gmail.com>
Sun, 11 Apr 2010 18:38:24 +0000 (19:38 +0100)
How it didn't crash before, no idea...

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

index 92b972499dd7fc0e35313192c781cd0337a19076..c6dbca6889ae47d7f83a69c1d6479d7d50b07dbf 100644 (file)
@@ -228,7 +228,7 @@ int elf_read_firmware(const char * file, elf_firmware_t * firmware)
                                        } else {
                                                // code
                                                if (firmware->codeline[sym.st_value >> 1] == NULL) {
-                                                       avr_symbol_t * s = firmware->codeline[sym.st_value >> 1] = malloc(sizeof(avr_symbol_t*));
+                                                       avr_symbol_t * s = firmware->codeline[sym.st_value >> 1] = malloc(sizeof(avr_symbol_t));
                                                        s->symbol = strdup(name);
                                                        s->addr = sym.st_value;
                                                }