Re: Mangling: grammar too permissive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Mangling: grammar too permissive
- To: cxx-abi@xxxxxxxxxxxxxxxxxxxx, Martin von Loewis <loewis@xxxxxxxxxxxxxxxxxxxxxxx>
- Subject: Re: Mangling: grammar too permissive
- From: dehnert@xxxxxxxxxxxxxxxxxxxx (Jim Dehnert)
- Date: Mon, 27 Mar 2000 19:37:43 -0800 (PST)
> From: Martin von Loewis <loewis@xxxxxxxxxxxxxxxxxxxxxxx>
>
> After reviewing today's mangling grammar, I found that it allows a
> number of constructions that can't possibly appear, and that can be
> easily correct in the grammar:
>
> 1. <substitution> in <qualified name>: This allows <nested-names> of
> NSi_E, where i is either a letter or a (base-36) digit. I think
> this cannot, or should not, occur: If you can substitute the entire
> <qualified-name>, you should use Si_ instead.
>
> Solution: Remove <substitution> alternative in <qualified name>
No, it's needed to be able to substitute for Ktype when we've
already seen VKtype.
> 2. extra alternatives in <encoding-type>: In all cases where an
> encoding-type can occur, it always identifies a
> bare-function-type; it never is a type or a substitution on its
> own. Therefore, I propose to remove the encoding-type, and replace
> its two occurences with bare-function-type.
No, <encoding-type> also encodes a <type> in the case of a vtable,
where <name> is the <special-name> VT, and <type> is the relevant class
type. (Though this could probably be fixed by other rearrangements.)
> 3. extern "C" allowed at toplevel. The grammar allows _Z3fooYi, which
> would be extern "C" ??? foo(int). However (as the text points out),
> that would be mangled as "foo", so it cannot happen.
> Solution: Move [Y] from <bare-function-type> into <function-type>.
OK, I did that.
Jim
- Jim Dehnert dehnert@xxxxxxx
(650)933-4272