Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions uc.c
Original file line number Diff line number Diff line change
Expand Up @@ -892,14 +892,18 @@ uc_err uc_vmem_write(uc_engine *uc, uint64_t address, uc_prot prot,
align = uc->target_page_align;
pagesize = uc->target_page_size;
len = MIN(size - count, (address & ~align) + pagesize - address);
if (uc_vmem_translate(uc, address, prot, &paddr) != UC_ERR_OK) {
if (uc_vmem_translate(uc, address, prot, &paddr) != UC_ERR_OK) {
restore_jit_state(uc);
return UC_ERR_WRITE_PROT;
}
}
if (uc_mem_write(uc, paddr, bytes, len) != UC_ERR_OK) {
restore_jit_state(uc);
return UC_ERR_WRITE_PROT;
}
if (uc_ctl_remove_cache(uc, address, address + len) != UC_ERR_OK) {
restore_jit_state(uc);
return UC_ERR_WRITE_PROT;
}
bytes += len;
address += len;
count += len;
Expand Down
Loading