target-alpha: fix uninitialized variable
PATCH 1/1 target-alpha: fix uninitialized variable
I am not sure why the compiler does not catch it. There is no semantic change since gen_excp returns EXIT_NORETURN, but the old code is wrong.
Reported by Coverity.
--- target-alpha/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target-alpha/translate.c +1 -1
@@ -2916,7 +2916,7 @@ void gen_intermediate_code(CPUAlphaState *env, struct TranslationBlock *tb) num_insns++;if (unlikely (cpu_breakpoint_test (cs, ctx.pc,BP_ANY ))) { -gen_excp (&ctx,EXCP_DEBUG ,0 ); + ret =gen_excp (&ctx,EXCP_DEBUG ,0 );break ; }if (num_insns == max_insns && (tb->cflags &CF_LAST_IO )) {
Signature · 1 line
2.5.0
Quoted 10 lines · Paolo Bonzini
I am not sure why the compiler does not catch it. There is no semantic change since
gen_excpreturnsEXIT_NORETURN, but the old code is wrong.Reported by Coverity.
Signed-off-by Paolo Bonzini<[email protected]>--- target-alpha/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
I assume this will go in via trivial.
r~
Quoted 7 lines · Richard Henderson
Quoted 6 lines · Paolo Bonzini
I am not sure why the compiler does not catch it. There is no semantic change since
gen_excpreturnsEXIT_NORETURN, but the old code is wrong.Reported by Coverity.
Quoted 8 lines
Quoted 4 lines
Signed-off-by Paolo Bonzini<[email protected]>--- target-alpha/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Reviewed-by Richard Henderson <[email protected]>I assume this will go in via trivial.
Richard, after your patch 522a0d4e3c0d397ffb45ec400d8cbd426dad9d17 "target-*: Advance pc after recognizing a breakpoint", this code needs another review I think, as you modified the subsequent line ;) Please take a look.
Thanks,
/mjt
Quoted 13 lines · Michael Tokarev
Quoted 12 lines · Richard Henderson
Quoted 10 lines · Paolo Bonzini
I am not sure why the compiler does not catch it. There is no semantic change since
gen_excpreturnsEXIT_NORETURN, but the old code is wrong.Reported by Coverity.
Signed-off-by Paolo Bonzini<[email protected]>--- target-alpha/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 8 lines
Quoted 3 lines
Reviewed-by Richard Henderson <[email protected]>I assume this will go in via trivial.
Richard, after your patch
522a0d4e3c0d397ffb45ec400d8cbd426dad9d17"target-*: Advance pc after recognizing a breakpoint", this code needs another review I think, as you modified the subsequent line ;) Please take a look.
It's okay, I noticed the conflict. Assigning the return value of gen_excp is still the right thing to do.
Paolo
Michael Tokarev
AppliedQuoted 3 lines · Paolo Bonzini
I am not sure why the compiler does not catch it. There is no semantic change since
gen_excpreturnsEXIT_NORETURN, but the old code is wrong.
Applied to -trivial. Indeed it's interesting why gcc can't catch it, might be due to unlikely() (which smells like a bug?)
Thanks,
/mjt