Le 04/02/2026 à 08:57, Sergei Heifetz a écrit :
> 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>
> ---
> dump/dump.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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) {
Reviewed-by: Laurent Vivier <laurent@vivier.eu>