mirror of
https://github.com/yuzu-emu/unicorn
synced 2024-11-25 00:28:21 +00:00
Merge pull request #513 from lunixbochs/go_binding_c99
fix Go binding C99 regression
This commit is contained in:
commit
affe94d5fe
1 changed files with 6 additions and 4 deletions
|
@ -4,7 +4,8 @@
|
|||
|
||||
uc_err uc_reg_read_batch_helper(uc_engine *handle, int *regs, uint64_t *val_out, int count) {
|
||||
void **val_ref = malloc(sizeof(void *) * count);
|
||||
for (int i = 0; i < count; i++) {
|
||||
int i;
|
||||
for (i = 0; i < count; i++) {
|
||||
val_ref[i] = (void *)&val_out[i];
|
||||
}
|
||||
uc_err ret = uc_reg_read_batch(handle, regs, val_ref, count);
|
||||
|
@ -13,11 +14,12 @@ uc_err uc_reg_read_batch_helper(uc_engine *handle, int *regs, uint64_t *val_out,
|
|||
}
|
||||
|
||||
uc_err uc_reg_write_batch_helper(uc_engine *handle, int *regs, uint64_t *val_in, int count) {
|
||||
const void **val_ref = malloc(sizeof(void *) * count);
|
||||
for (int i = 0; i < count; i++) {
|
||||
void **val_ref = malloc(sizeof(void *) * count);
|
||||
int i;
|
||||
for (i = 0; i < count; i++) {
|
||||
val_ref[i] = (void *)&val_in[i];
|
||||
}
|
||||
uc_err ret = uc_reg_write_batch(handle, regs, val_ref, count);
|
||||
uc_err ret = uc_reg_write_batch(handle, regs, (void *const *)val_ref, count);
|
||||
free(val_ref);
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue