Mangling: grammar too permissive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Mangling: grammar too permissive
- To: cxx-abi@xxxxxxxxxxxxxxxxxxxx
- Subject: Mangling: grammar too permissive
- From: Martin von Loewis <loewis@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 27 Mar 2000 15:48:02 +0200
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>
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.
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>.
Regards,
Martin