From 025e32df4a873b32442c1fc66cad9dc690ff85aa Mon Sep 17 00:00:00 2001 From: lazymio Date: Thu, 4 Nov 2021 20:00:01 +0100 Subject: [PATCH] Init uc on cpu model read --- uc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/uc.c b/uc.c index 1325217f..2f0acbe6 100644 --- a/uc.c +++ b/uc.c @@ -2065,6 +2065,9 @@ uc_err uc_ctl(uc_engine *uc, uc_control_type control, ...) case UC_CTL_CPU_MODEL: { if (rw == UC_CTL_IO_READ) { + + UC_INIT(uc); + int *model = va_arg(args, int *); *model = uc->cpu_model; } else {