summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--examples/exception-handler.c2
-rw-r--r--vm.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/examples/exception-handler.c b/examples/exception-handler.c
index 1e722ec..a9a0299 100644
--- a/examples/exception-handler.c
+++ b/examples/exception-handler.c
@@ -30,7 +30,7 @@ static const char *program = MULTILINE_STRING(
doesnotexist();
}
- fail();
+ map([1], x => fail(x));
%}
);
diff --git a/vm.c b/vm.c
index 2c8f524..65d6c81 100644
--- a/vm.c
+++ b/vm.c
@@ -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);