mirror of
https://github.com/qemu/qemu.git
synced 2026-05-17 15:37:11 +00:00
dump/dump.c: reorder usage and assertion of block
Reorder the code so the assertion of block occurs before it is used in the subsequent lines. Signed-off-by: Sergei Heifetz <heifetz@yandex-team.com> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Peter Xu <peterx@redhat.com> Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
committed by
Michael Tokarev
parent
455c908278
commit
de49227611
@@ -1288,6 +1288,7 @@ static bool get_next_page(GuestPhysBlock **blockptr, uint64_t *pfnptr,
|
||||
/* block == NULL means the start of the iteration */
|
||||
if (!block) {
|
||||
block = QTAILQ_FIRST(&s->guest_phys_blocks.head);
|
||||
assert(block);
|
||||
*blockptr = block;
|
||||
addr = block->target_start;
|
||||
*pfnptr = dump_paddr_to_pfn(s, addr);
|
||||
@@ -1295,7 +1296,6 @@ static bool get_next_page(GuestPhysBlock **blockptr, uint64_t *pfnptr,
|
||||
*pfnptr += 1;
|
||||
addr = dump_pfn_to_paddr(s, *pfnptr);
|
||||
}
|
||||
assert(block != NULL);
|
||||
|
||||
while (1) {
|
||||
if (addr >= block->target_start && addr < block->target_end) {
|
||||
|
||||
Reference in New Issue
Block a user