AlexAltea / unicorn.js

Unicorn CPU emulator framework port for JavaScript
https://alexaltea.github.io/unicorn.js/
GNU General Public License v2.0
566 stars 36 forks source link

Unaligned memory access #10

Closed flowergrass closed 7 years ago

flowergrass commented 7 years ago

There is an unaligned memory access within the file unicorn/qemu/include/exec/exec-all.h at line 218.

static inline void tb_set_jmp_target1(uintptr_t jmp_addr, uintptr_t addr)
{
    /* patch the branch destination */
    *(uint32_t *)jmp_addr = addr - (jmp_addr + 4);
    /* no need to flush icache explicitly */
}
dpgeorge commented 7 years ago

Thanks for the quick turn-around on this issue!

AlexAltea commented 7 years ago

@dpgeorge You're welcome. I'm glad you guys are giving Unicorn.js something challenging that finds broken cases I missed while porting it.

PS: I really like the idea of MicroPython. Hats off. :-)

dpgeorge commented 7 years ago

I'm glad you guys are giving Unicorn.js something challenging

Well this is just the beginning... if unicorn.js can work flawlessly (to the same level as the C version) then we have a whole lot of cool stuff to throw at it :)