From 881fd3b671188945581c15feef3dbdd9b0af9102 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 7 Feb 2022 09:59:26 +0100 Subject: [PATCH] ucode: adjust to latest ucode api The public libucode api has been revised to return and expect an uc_program_t pointer instead of a main function reference. The program (former main function) is also not implicitly released by uc_vm_execute() anymore. Adjust the ucode plugin accordingly to match the new requirements. Signed-off-by: Jo-Philipp Wich --- ucode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ucode.c b/ucode.c index f408576..69da3da 100644 --- a/ucode.c +++ b/ucode.c @@ -220,7 +220,7 @@ uh_ucode_state_init(struct ucode_prefix *ucode) { char *syntax_error = NULL; uc_vm_t *vm = &ucode->ctx; - uc_function_t *handler; + uc_program_t *handler; uc_vm_status_t status; uc_source_t *src; uc_value_t *v; @@ -275,6 +275,7 @@ uh_ucode_state_init(struct ucode_prefix *ucode) status = uc_vm_execute(vm, handler, &v); exitcode = (int)ucv_int64_get(v); + uc_program_put(handler); ucv_put(v); switch (status) { -- 2.30.2