qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: typo in target-i386/ops_sse.h


From: Jan Kiszka
Subject: [Qemu-devel] Re: typo in target-i386/ops_sse.h
Date: Fri, 28 Nov 2008 00:13:08 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

andrzej zaborowski wrote:
> Hi,
> 
> 2008/11/27 Frank Mehnert <address@hidden>:
>> I believe there is a typo in target-i386/ops_sse.h in the macro
>> SSE_HELPER_F:
> 
> Ooops, you're right about the typo, but I think it should something like this:
> --- a/target-i386/ops_sse.h
> +++ b/target-i386/ops_sse.h
> @@ -1499,12 +1499,12 @@ void glue(name, SUFFIX) (Reg *d, Reg *s)\
>  {\
>      d->elem(0) = F(0);\
>      d->elem(1) = F(1);\
> -    d->elem(2) = F(2);\
> -    d->elem(3) = F(3);\
> -    if (num > 3) {\
> -        d->elem(4) = F(4);\
> -        d->elem(5) = F(5);\
> -        if (num > 5) {\
> +    if (num > 2) {\
> +        d->elem(2) = F(2);\
> +        d->elem(3) = F(3);\
> +        if (num > 4) {\
> +            d->elem(4) = F(4);\
> +            d->elem(5) = F(5);\
>              d->elem(6) = F(6);\
>              d->elem(7) = F(7);\
>          }\
> 
> I'm not sure why this didn't generate warnings.

It does - with gcc4 (array subscript is above array bounds). I saw them
in kvm-userspace, but there were so many (a lot likely due to
non-upstream stuff) that I ignored them for now. Now your patch just
removed 8 upstream warnings. But is this stuff already in use? Should
cause subtle guest state corruptions if actually executed.

That reminds me that we should have a "zero new warnings policy" for
changes. But reality still looks different...

Jan

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]