save cpu->jmp_env in saving context, so uc_emu_start() can be reentrant. also improved Python binding on handling context

This commit is contained in:
Nguyen Anh Quynh
2020-06-05 20:12:44 +08:00
parent a4784cc96c
commit 2e0f753e6f
5 changed files with 34 additions and 31 deletions

View File

@ -253,9 +253,11 @@ struct uc_struct {
};
// Metadata stub for the variable-size cpu context used with uc_context_*()
// We also save cpu->jmp_env, so emulation can be reentrant
struct uc_context {
size_t size;
char data[0];
size_t context_size; // size of the real internal context structure
unsigned int jmp_env_size; // size of cpu->jmp_env
char data[0]; // context + cpu->jmp_env
};
// check if this address is mapped in (via uc_mem_map())