Commit de49227611 for qemu.org

commit de49227611d4ec6b86ffa204220b2c320840055f
Author: Sergei Heifetz <heifetz@yandex-team.com>
Date:   Sun Feb 8 15:39:56 2026 +0500

    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>

diff --git a/dump/dump.c b/dump/dump.c
index f7a99a7af2..80ed6c8d21 100644
--- a/dump/dump.c
+++ b/dump/dump.c
@@ -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) {