qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] target/sh4: Return error if CPUClass::get_phys_page_debug()


From: Richard Henderson
Subject: Re: [PATCH] target/sh4: Return error if CPUClass::get_phys_page_debug() fails
Date: Wed, 5 May 2021 09:52:37 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1

On 5/5/21 9:10 AM, Philippe Mathieu-Daudé wrote:
If the get_physical_address() call fails, the SH4 get_phys_page_debug()
handler returns an uninitialized address. Instead return -1, which
correspond to "no page found" (see cpu_get_phys_page_debug() doc
string).

This fixes a warning emitted when building with CFLAGS=-O3
(using GCC 10.2.1 20201125):

   target/sh4/helper.c: In function ‘superh_cpu_get_phys_page_debug’:
   target/sh4/helper.c:446:12: warning: ‘physical’ may be used uninitialized in 
this function [-Wmaybe-uninitialized]
     446 |     return physical;
         |            ^~~~~~~~

Signed-off-by: Philippe Mathieu-Daudé<f4bug@amsat.org>
---
  target/sh4/helper.c | 7 +++++--
  1 file changed, 5 insertions(+), 2 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]