Re: [PATCH] handle qualified anonymous structures

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

 



On Fri, Jan 22, 2021 at 8:26 AM Luc Van Oostenryck
<luc.vanoostenryck@xxxxxxxxx> wrote:
>
> So, the solution chosen here is to handle this during type examination,
> more precisely, inside examine_struct_union_type(), where things are
> a bit more complicated

Well, doesn't look all that complicated to me.

The only thing I would do is to just at the head of that function do:

        unsigned long mod = sym->ctype.modifiers & MOD_QUALIFIER;

        if (!mod)
                return;

and that also means that you can avoid the "parent-vs-sym" thing,
because the symbol is never used after that, so you don't need to
create a new one.

The other thing that might be worth doing is to just make sure that
the "sub" whose modifier you change is always a SYM_NODE. We never
want to touch an actual type, only the node.

I don't think it _can_ be anything else (that's how the struct/union
symbol_list should be set up), but since this is a very unusual case
of going back and modifying a symbol after the fact, I think I'd be a
bit more comfortable with that kind of sanity check.

Hmm?

Anyway, looks good, and obviously passes my trivial test-case.

               Linus



[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