summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--vm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/vm.c b/vm.c
index e0cac6f..e29a6ed 100644
--- a/vm.c
+++ b/vm.c
@@ -459,6 +459,7 @@ uc_vm_call_function(uc_vm_t *vm, uc_value_t *ctx, uc_value_t *fno, bool mcall, s
/* XXX: make dependent on stack size */
if (vm->callframes.count >= 1000) {
uc_vm_raise_exception(vm, EXCEPTION_RUNTIME, "Too much recursion");
+ ucv_put(ctx);
ucv_put(fno);
return false;
@@ -528,6 +529,7 @@ uc_vm_call_function(uc_vm_t *vm, uc_value_t *ctx, uc_value_t *fno, bool mcall, s
if (ucv_type(fno) != UC_CLOSURE) {
uc_vm_raise_exception(vm, EXCEPTION_TYPE, "left-hand side is not a function");
+ ucv_put(ctx);
ucv_put(fno);
return false;