qemu-e2k/target
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
..
alpha target/alpha: Remove NB_MMU_MODES define 2023-03-13 06:44:37 -07:00
arm target/arm: Copy guarded bit in combine_cacheattrs 2023-04-10 14:31:40 +01:00
avr target/avr: Avoid use of tcg_const_i32 throughout 2023-03-13 06:44:37 -07:00
cris target/cris: Avoid use of tcg_const_i32 throughout 2023-03-13 06:44:37 -07:00
hexagon target/hexagon: Remove NB_MMU_MODES define 2023-03-13 06:44:37 -07:00
hppa target/hppa: Avoid use of tcg_const_i32 throughout 2023-03-13 06:44:37 -07:00
i386 target/i386: Avoid unreachable variable declaration in mmu_translate() 2023-04-20 11:17:35 +02:00
loongarch target/loongarch: Enables plugins to get instruction codes 2023-04-04 19:33:23 +08:00
m68k target/m68k: Use tcg_constant_i32 in gen_ea_mode 2023-03-13 07:03:39 -07:00
microblaze target/microblaze: Remove NB_MMU_MODES define 2023-03-13 06:44:37 -07:00
mips *: Add missing includes of qemu/error-report.h 2023-03-22 15:06:57 +00:00
nios2 target/nios2: Remove NB_MMU_MODES define 2023-03-13 06:44:37 -07:00
openrisc target/openrisc: Remove NB_MMU_MODES define 2023-03-13 06:44:37 -07:00
ppc target/ppc: Fix temp usage in gen_op_arith_modw 2023-04-09 19:21:27 +02:00
riscv target/riscv: Remove NB_MMU_MODES define 2023-03-13 06:44:37 -07:00
rx target/rx: Avoid tcg_const_i32 2023-03-13 06:44:37 -07:00
s390x softmmu: Restrict cpu_check_watchpoint / address_matches to TCG accel 2023-03-28 15:24:06 -07:00
sh4 target/sh4: Honor QEMU_LOG_FILENAME with QEMU_LOG=cpu 2023-03-16 10:31:25 +01:00
sparc tcg/sparc: Avoid tcg_const_tl in gen_edge 2023-03-13 06:44:37 -07:00
tricore target/tricore: Use min/max for saturate 2023-03-13 07:03:39 -07:00
xtensa target/xtensa: Remove NB_MMU_MODES define 2023-03-13 06:44:37 -07:00
Kconfig
meson.build