Skip to content

Commit

Permalink
Changed argument type for the ks_free function
Browse files Browse the repository at this point in the history
* ks_free: The 'p' argument should have type unsigned char* to match the type of the 'encoding' argument to ks_asm
  • Loading branch information
adrianherrera committed Jun 5, 2016
1 parent 8b20229 commit 41c9d1c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bindings/python/keystone/keystone.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ def _setup_prototype(lib, fname, restype, *argtypes):
_setup_prototype(_ks, "ks_close", kserr, ks_engine)
_setup_prototype(_ks, "ks_strerror", c_char_p, kserr)
_setup_prototype(_ks, "ks_errno", kserr, ks_engine)
_setup_prototype(_ks, "ks_option", kserr, ks_engine, c_int, c_void_p)
_setup_prototype(_ks, "ks_option", kserr, ks_engine, c_int, c_size_t)
# int ks_asm(ks_engine *ks, const char *string, uint64_t address, unsigned char **encoding, size_t *encoding_size, size_t *stat_count);
_setup_prototype(_ks, "ks_asm", c_int, ks_engine, c_char_p, c_uint64, POINTER(POINTER(c_ubyte)), POINTER(c_size_t), POINTER(c_size_t))
_setup_prototype(_ks, "ks_free", None, c_void_p)
_setup_prototype(_ks, "ks_free", None, POINTER(c_ubyte))


# access to error code via @errno of KsError
Expand Down
2 changes: 1 addition & 1 deletion include/keystone/keystone.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ int ks_asm(ks_engine *ks,
@p: memory allocated in @encoding argument of ks_asm()
*/
KEYSTONE_EXPORT
void ks_free(void *p);
void ks_free(unsigned char *p);


#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion llvm/keystone/ks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ ks_err ks_option(ks_engine *ks, ks_opt_type type, size_t value)


KEYSTONE_EXPORT
void ks_free(void *p)
void ks_free(unsigned char *p)
{
free(p);
}
Expand Down

0 comments on commit 41c9d1c

Please sign in to comment.