From 20bdbf638d1d9312676f4d3ec96d0f52fb8508cd Mon Sep 17 00:00:00 2001 From: Jonathon Reinhart Date: Wed, 26 Aug 2015 07:36:20 -0400 Subject: [PATCH] change uc_hook_del() to take hook handle by value --- include/unicorn/unicorn.h | 2 +- uc.c | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/include/unicorn/unicorn.h b/include/unicorn/unicorn.h index 714feaae..14102c97 100644 --- a/include/unicorn/unicorn.h +++ b/include/unicorn/unicorn.h @@ -382,7 +382,7 @@ uc_err uc_hook_add(struct uc_struct *uc, uc_hook_h *hh, uc_hook_t type, void *ca for detailed error). */ UNICORN_EXPORT -uc_err uc_hook_del(struct uc_struct *uc, uc_hook_h *hh); +uc_err uc_hook_del(struct uc_struct *uc, uc_hook_h hh); /* Map memory in for emulation. diff --git a/uc.c b/uc.c index 3db2778f..3effa782 100644 --- a/uc.c +++ b/uc.c @@ -649,12 +649,8 @@ uc_err uc_hook_add(struct uc_struct *uc, uc_hook_h *hh, uc_hook_t type, void *ca } UNICORN_EXPORT -uc_err uc_hook_del(struct uc_struct *uc, uc_hook_h *hh) +uc_err uc_hook_del(struct uc_struct *uc, uc_hook_h hh) { - if (*hh == 0) - // invalid handle - return UC_ERR_HANDLE; - return hook_del(uc, hh); }