Support nested uc_emu_start calls

This commit is contained in:
2021-11-16 21:07:03 +01:00
parent 43c643d4af
commit 247ffbe0e8
5 changed files with 54 additions and 2 deletions

View File

@@ -551,8 +551,10 @@ int cpu_exec(struct uc_struct *uc, CPUState *cpu)
*/
// init_delay_params(&sc, cpu);
// Unicorn: We would like to support nested uc_emu_start calls.
/* prepare setjmp context for exception handling */
if (sigsetjmp(cpu->jmp_env, 0) != 0) {
// if (sigsetjmp(cpu->jmp_env, 0) != 0) {
if (sigsetjmp(uc->jmp_bufs[uc->nested_level - 1], 0) != 0) {
#if defined(__clang__) || !QEMU_GNUC_PREREQ(4, 6)
/* Some compilers wrongly smash all local variables after
* siglongjmp. There were bug reports for gcc 4.5.0 and clang.