Re: [PATCH] Fix offsets in anonymous unions

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

 



On Thu, May 22, 2014 at 6:22 AM, John Keeping <john@xxxxxxxxxxxxx> wrote:
> Commit 38d1124 (Fix error at anoymous unions, 2014-04-03) says:
> @@ -2328,6 +2326,7 @@ static struct expression *check_designators(struct expression *e,
>                                 break;
>                         }
>                         e->field = e->ctype = ctype;
> +                       e->init_offset = offset;
>                         last = e;
>                         if (!e->ident_expression) {

OK, this is actually wrong. The member "init_offset" is only
valid for EXPR_POS type. The current e->type is EXPR_IDENTIFIER,
the e->init_offset member actually share the same memory location as
e->expr_ident. In order words, writing to init_offset will corrupt the
e->expr_ident. We did not use e->expr_ident afterwards though.


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