qemu-e2k/target/i386/tcg
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
..
sysemu target/i386: Avoid unreachable variable declaration in mmu_translate() 2023-04-20 11:17:35 +02:00
user
bpt_helper.c
cc_helper_template.h
cc_helper.c target/i386: Expand eflags updates inline 2022-11-01 08:31:41 +11:00
decode-new.c.inc target/i386: Drop tcg_temp_free 2023-03-05 13:44:08 -08:00
decode-new.h target/i386: implement FMA instructions 2022-10-22 09:05:54 +02:00
emit.c.inc target/i386: Drop tcg_temp_free 2023-03-05 13:44:08 -08:00
excp_helper.c
fpu_helper.c target/i386: introduce function to set rounding mode from FPCW or MXCSR bits 2022-10-20 15:16:13 +02:00
helper-tcg.h
int_helper.c
mem_helper.c target/i386: Inline cmpxchg16b 2023-02-04 06:19:43 -10:00
meson.build
misc_helper.c
mpx_helper.c
seg_helper.c i386: Emit correct error code for 64-bit IDT entry 2023-01-11 09:59:38 +01:00
seg_helper.h
tcg-cpu.c target/i386: Replace tb_pc() with tb->pc 2023-03-01 07:33:20 -10:00
tcg-cpu.h
tcg-stub.c
translate.c target/i386: Avoid use of tcg_const_* throughout 2023-03-13 06:44:37 -07:00