flush JIT cache before finishing emulation. this fixes issue #263. TODO: optimize this for better performance

This commit is contained in:
Nguyen Anh Quynh 2015-11-13 23:57:03 +08:00
parent 1ba39a582c
commit 9099755ca1

View file

@ -271,6 +271,11 @@ int cpu_exec(struct uc_struct *uc, CPUArchState *env) // qq
cc->cpu_exec_exit(cpu);
// Unicorn: flush JIT cache to because emulation might stop in
// the middle of translation, thus generate incomplete code.
// TODO: optimize this for better performance
tb_flush(env);
/* fail safe : never use current_cpu outside cpu_exec() */
uc->current_cpu = NULL;
return ret;