qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] target-alpha: fix uninitialized variable
@ 2015-10-19 14:08 Paolo Bonzini
  2015-10-21 23:15 ` Richard Henderson
  2015-10-29  7:49 ` Michael Tokarev
  0 siblings, 2 replies; 5+ messages in thread
From: Paolo Bonzini @ 2015-10-19 14:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial

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.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target-alpha/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target-alpha/translate.c b/target-alpha/translate.c
index f936d1b..53f6833 100644
--- a/target-alpha/translate.c
+++ b/target-alpha/translate.c
@@ -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)) {
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] target-alpha: fix uninitialized variable
  2015-10-19 14:08 [Qemu-devel] [PATCH] target-alpha: fix uninitialized variable Paolo Bonzini
@ 2015-10-21 23:15 ` Richard Henderson
  2015-11-03 12:01   ` Michael Tokarev
  2015-10-29  7:49 ` Michael Tokarev
  1 sibling, 1 reply; 5+ messages in thread
From: Richard Henderson @ 2015-10-21 23:15 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel; +Cc: qemu-trivial

On 10/19/2015 04:08 AM, Paolo Bonzini wrote:
> 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.
>
> Signed-off-by: Paolo Bonzini<pbonzini@redhat.com>
> ---
>   target-alpha/translate.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Richard Henderson <rth@twiddle.net>

I assume this will go in via trivial.


r~

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] target-alpha: fix uninitialized variable
  2015-10-19 14:08 [Qemu-devel] [PATCH] target-alpha: fix uninitialized variable Paolo Bonzini
  2015-10-21 23:15 ` Richard Henderson
@ 2015-10-29  7:49 ` Michael Tokarev
  1 sibling, 0 replies; 5+ messages in thread
From: Michael Tokarev @ 2015-10-29  7:49 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel; +Cc: qemu-trivial

19.10.2015 17:08, Paolo Bonzini wrote:
> 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.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] target-alpha: fix uninitialized variable
  2015-10-21 23:15 ` Richard Henderson
@ 2015-11-03 12:01   ` Michael Tokarev
  2015-11-03 12:06     ` Paolo Bonzini
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Tokarev @ 2015-11-03 12:01 UTC (permalink / raw)
  To: Richard Henderson, Paolo Bonzini, qemu-devel; +Cc: qemu-trivial

22.10.2015 02:15, Richard Henderson wrote:
> On 10/19/2015 04:08 AM, Paolo Bonzini wrote:
>> 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.
>>
>> Signed-off-by: Paolo Bonzini<pbonzini@redhat.com>
>> ---
>>   target-alpha/translate.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Reviewed-by: Richard Henderson <rth@twiddle.net>
> 
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] target-alpha: fix uninitialized variable
  2015-11-03 12:01   ` Michael Tokarev
@ 2015-11-03 12:06     ` Paolo Bonzini
  0 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2015-11-03 12:06 UTC (permalink / raw)
  To: Michael Tokarev, Richard Henderson, qemu-devel; +Cc: qemu-trivial



On 03/11/2015 13:01, Michael Tokarev wrote:
> 22.10.2015 02:15, Richard Henderson wrote:
>> On 10/19/2015 04:08 AM, Paolo Bonzini wrote:
>>> 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.
>>>
>>> Signed-off-by: Paolo Bonzini<pbonzini@redhat.com>
>>> ---
>>>   target-alpha/translate.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> Reviewed-by: Richard Henderson <rth@twiddle.net>
>>
>> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-11-03 12:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-19 14:08 [Qemu-devel] [PATCH] target-alpha: fix uninitialized variable Paolo Bonzini
2015-10-21 23:15 ` Richard Henderson
2015-11-03 12:01   ` Michael Tokarev
2015-11-03 12:06     ` Paolo Bonzini
2015-10-29  7:49 ` Michael Tokarev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).