check arguments, return error instead of raising exceptions. (#1125)
* check arguments, return error instaed of raising exceptions. close #1117. * remove empty lines. remove thr underscore prefix in function name.
This commit is contained in:
committed by
Nguyen Anh Quynh
parent
bc572be472
commit
23a426625f
7
uc.c
7
uc.c
@@ -371,12 +371,13 @@ uc_err uc_reg_read_batch(uc_engine *uc, int *ids, void **vals, int count)
|
||||
UNICORN_EXPORT
|
||||
uc_err uc_reg_write_batch(uc_engine *uc, int *ids, void *const *vals, int count)
|
||||
{
|
||||
int ret = UC_ERR_OK;
|
||||
if (uc->reg_write)
|
||||
uc->reg_write(uc, (unsigned int *)ids, vals, count);
|
||||
ret = uc->reg_write(uc, (unsigned int *)ids, vals, count);
|
||||
else
|
||||
return -1; // FIXME: need a proper uc_err
|
||||
return UC_ERR_EXCEPTION; // FIXME: need a proper uc_err
|
||||
|
||||
return UC_ERR_OK;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user