diff options
author | Jo-Philipp Wich <jo@mein.io> | 2021-09-24 09:56:04 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2021-09-24 09:56:04 +0200 |
commit | ce4a7d96a648d37a95ebe07dfef522073c1b2fae (patch) | |
tree | c736345a8db0702b7b6804c1479e180cb2014352 /vm.c | |
parent | 218e8221a80a8fcf8bfd6cc115d7a0ae00a65ead (diff) |
vm: reset callframes before invoking unhandled exception handler
Reset all callframes when dealing with an unhandled exception to avoid
resuming the code which raised the exception when restarting the VM
later, e.g. through uc_vm_call() or uc_vm_invoke().
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -2278,6 +2278,8 @@ uc_vm_execute_chunk(uc_vm_t *vm) while (!uc_vm_handle_exception(vm)) { /* no further callframe to pop, report unhandled exception and terminate */ if (vm->callframes.count <= 1) { + uc_vm_reset_callframes(vm); + if (vm->exhandler) vm->exhandler(vm, &vm->exception); |