llvm-project/libcxxabi
Nathan Sidwell ad46cf14d4 [demangler] Stricter NestedName parsing
The parsing of nested names is a little lax.  This corrects that.

1) The 'L' local name prefix cannot appear before a NestedName -- only
within it.  Let's remove that check from parseName, and then adjust
parseUnscopedName to allow it with or without the 'St' prefix.

2) In a nested name, a <template-param>, <decltype> or <substitution>
can only appear as the first element.  Let's enforce that.  Note I do
not remove these from the loop, to make the change easier to follow
(such a change will come later).

3) Given that, there's no need to special case 'St' outside of the
loop, handle it with the other 'S' elements.

4) There's no need to reset 'EndsWithTemplateArgs' after each
non-template-arg component.  Rather, always clear it and then set it
in the template-args case.

5) An template-args cannot immediately follow a template-args.

6) The parsing of a CDtor name with ABITags would attach the tags to
the NestedName node, rather than the CDTor node.  This is different to
how ABITags are attached to an unscopedName.  Make it consistent.

7) We remain with only CDTor and UnscopedName requireing construction
of a NestedName, so let's drop the PushComponent lambda.

8) Add some tests to catch the new rejected manglings.

Reviewed By: ChuanqiXu

Differential Revision: https://reviews.llvm.org/D118132
2022-02-07 08:20:45 -08:00
..
cmake [libc++] Disable coverage with sanitize-coverage=0 2022-01-07 17:53:21 -08:00
fuzz
include [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
lib [libc++/abi] Revert "[libc++] Move the weak symbols list to libc++abi" 2020-10-05 11:42:13 -04:00
src [demangler] Stricter NestedName parsing 2022-02-07 08:20:45 -08:00
test [demangler] Stricter NestedName parsing 2022-02-07 08:20:45 -08:00
www [Branch-Rename] Fix some links 2021-02-01 16:43:21 +05:30
.clang-format [NFC][libcxxabi] Run clang-format on libcxxabi/src/cxa_guard_impl.h 2021-08-18 19:09:16 -04:00
.gitignore
CMakeLists.txt [cmake] Make include(GNUInstallDirs) always below project(..) 2022-01-20 18:59:17 +00:00
CREDITS.TXT
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00