diff options
author | Philippe Mathieu-Daudé | 2021-05-05 18:10:46 +0200 |
---|---|---|
committer | Laurent Vivier | 2021-05-13 19:00:50 +0200 |
commit | 52a1c621f9d56d18212273c64b4119513a2db1f1 (patch) | |
tree | 0c466193186cb1882d446cdcc5953e20539c57ae /hw/timer/xilinx_timer.c | |
parent | multi-process: Avoid logical AND of mutually exclusive tests (diff) | |
download | qemu-52a1c621f9d56d18212273c64b4119513a2db1f1.tar.gz qemu-52a1c621f9d56d18212273c64b4119513a2db1f1.tar.xz qemu-52a1c621f9d56d18212273c64b4119513a2db1f1.zip |
target/sh4: Return error if CPUClass::get_phys_page_debug() fails
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>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Message-Id: <20210505161046.1397608-1-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'hw/timer/xilinx_timer.c')
0 files changed, 0 insertions, 0 deletions