|
From: | Thomas Huth |
Subject: | Re: [PATCH 3/5] bulk: Replace [g_]assert(0) -> g_assert_not_reached() |
Date: | Wed, 22 Feb 2023 12:56:31 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 |
On 22/02/2023 00.25, Philippe Mathieu-Daudé wrote:
In order to avoid warnings such commit c0a6665c3c ("target/i386: Remove compilation errors when -Werror=maybe-uninitialized"), replace all assert(0) and g_assert(0) by g_assert_not_reached(). Remove any code following g_assert_not_reached(). See previous commit for rationale. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> ---
...
diff --git a/hw/net/i82596.c b/hw/net/i82596.c index ec21e2699a..eda0f586fb 100644 --- a/hw/net/i82596.c +++ b/hw/net/i82596.c @@ -285,7 +285,7 @@ static void command_loop(I82596State *s) case CmdDump: case CmdDiagnose: printf("FIXME Command %d !!\n", cmd & 7); - assert(0); + g_assert_not_reached(); }
While looking at this patch a second time, this hunk caught my eye. It looks like the guest could use these commands to crash QEMU? Should this be a qemu_log_mask(LOG_UNIMP,...) + graceful return instead?
Thomas
[Prev in Thread] | Current Thread | [Next in Thread] |