summaryrefslogtreecommitdiffhomepage
path: root/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib.c b/lib.c
index c9ebcb2..e95edd8 100644
--- a/lib.c
+++ b/lib.c
@@ -266,14 +266,9 @@ static void
uc_vm_ctx_push(uc_vm *vm)
{
uc_value_t *ctx = NULL;
- size_t i;
- for (i = vm->callframes.count; i > 0; i--) {
- if (vm->callframes.entries[i - 1].ctx) {
- ctx = vm->callframes.entries[i - 1].ctx;
- break;
- }
- }
+ if (vm->callframes.count >= 2)
+ ctx = vm->callframes.entries[vm->callframes.count - 2].ctx;
uc_vm_stack_push(vm, ucv_get(ctx));
}