Merge pull request #1765 from PhilippTakacs/split

Do not search for the RAMBlock in split_region
This commit is contained in:
2023-01-24 21:08:04 +01:00
committed by GitHub

11
uc.c
View File

@@ -1254,14 +1254,7 @@ static bool split_region(struct uc_struct *uc, MemoryRegion *mr,
// Find the correct and large enough (which contains our target mr) // Find the correct and large enough (which contains our target mr)
// to create the content backup. // to create the content backup.
QLIST_FOREACH(block, &uc->ram_list.blocks, next) block = mr->ram_block;
{
// block->offset is the offset within ram_addr_t, not GPA
if (block->mr->addr <= mr->addr &&
block->used_length + block->mr->addr >= mr->end) {
break;
}
}
if (block == NULL) { if (block == NULL) {
return false; return false;
@@ -2431,4 +2424,4 @@ void trace_end(uc_tracer *tracer, trace_loc loc, const char *fmt, ...)
fprintf(stderr, "%.6fus\n", fprintf(stderr, "%.6fus\n",
(double)(end - tracer->starts[loc]) / (double)(1000)); (double)(end - tracer->starts[loc]) / (double)(1000));
} }
#endif #endif