qemu-e2k/target/i386
Peter Maydell 987b63f24a target/i386: Avoid unreachable variable declaration in mmu_translate()
Coverity complains (CID 1507880) that the declaration "int error_code;"
in mmu_translate() is unreachable code. Since this is only a declaration,
this isn't actually a bug, but:
 * it's a bear-trap for future changes, because if it was changed to
   include an initialization 'int error_code = foo;' then the
   initialization wouldn't actually happen (being dead code)
 * it's against our coding style, which wants declarations to be
   at the start of blocks
 * it means that anybody reading the code has to go and look up
   exactly what the C rules are for skipping over variable declarations
   using a goto

Move the declaration to the top of the function.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20230406155946.3362077-1-peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2023-04-20 11:17:35 +02:00
..
hax
hvf
kvm *: Add missing includes of qemu/error-report.h 2023-03-22 15:06:57 +00:00
nvmm
tcg target/i386: Avoid unreachable variable declaration in mmu_translate() 2023-04-20 11:17:35 +02:00
whpx *: Add missing includes of qemu/error-report.h 2023-03-22 15:06:57 +00:00
arch_dump.c
arch_memory_mapping.c
cpu-dump.c
cpu-internal.h
cpu-param.h target/i386: Remove NB_MMU_MODES define 2023-03-13 06:44:37 -07:00
cpu-qom.h
cpu-sysemu.c
cpu.c *: Add missing includes of qemu/error-report.h 2023-03-22 15:06:57 +00:00
cpu.h i386/xen: handle PV timer hypercalls 2023-03-01 09:07:52 +00:00
gdbstub.c gdbstub: move register helpers into standalone include 2023-03-07 20:44:08 +00:00
helper.c target/i386: Replace TARGET_TB_PCREL with CF_PCREL 2023-03-01 07:31:56 -10:00
helper.h
host-cpu.c *: Add missing includes of qemu/error-report.h 2023-03-22 15:06:57 +00:00
host-cpu.h
Kconfig
machine.c i386/xen: handle PV timer hypercalls 2023-03-01 09:07:52 +00:00
meson.build
monitor.c
ops_sse_header.h
ops_sse.h
sev-sysemu-stub.c
sev.c *: Add missing includes of qemu/error-report.h 2023-03-22 15:06:57 +00:00
sev.h
shift_helper_template.h
svm.h
trace-events
trace.h
xsave_helper.c