Re: [PATCH] fix size of loaded bitfields

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

 



On Fri, Feb 17, 2017 at 10:44 AM, Luc Van Oostenryck
<luc.vanoostenryck@xxxxxxxxx> wrote:
> Loading a bitfield correctly take in account the offset
> of the bitfield inside the whole container integer.
> But truncating it to the width of the bitfield is not done
> or is done very implicitely (because the correct size is not lost).

> Fix this by adding the missing truncating cast.
> This will then gives something like:
>         get__bfu_a:
>                 cast.3      %r2 <- (32) %arg1
>                 cast.32     %r3 <- (3) %r2
>                 ret.32      %r3

The patch looks good. Applied to sparse-next.

> +       if (ad->bit_size != type_size(ad->source_type)) {
> +               new = cast_pseudo(ep, new, ad->source_type, ad->result_type);
> +       }

One minor nick pick, if there is only one line, there are no
braces needed.

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux