[all-commits] [llvm/llvm-project] 624473: [demangler] Reorder parseNestedName loop

Nathan Sidwell via All-commits all-commits at lists.llvm.org
Wed Feb 16 04:31:57 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6244730e29f66ae3d0ba80c2341f9f17c7eb78d3
      https://github.com/llvm/llvm-project/commit/6244730e29f66ae3d0ba80c2341f9f17c7eb78d3
  Author: Nathan Sidwell <nathan at acm.org>
  Date:   2022-02-16 (Wed, 16 Feb 2022)

  Changed paths:
    M libcxxabi/src/demangle/ItaniumDemangle.h
    M libcxxabi/test/test_demangle.pass.cpp
    M llvm/include/llvm/Demangle/ItaniumDemangle.h

  Log Message:
  -----------
  [demangler] Reorder parseNestedName loop

parseNestedName's main loop allowed parsing a grammar that was more
flexible than the actual grammar.  This refactors that to rule out
some more incorrect manglings.

1) The 'L' extension only applies to unqualified-name components, so
check it just there.

2) The 'M' suffix is, AFAICT, removed from the grammar.  Rather than
eliminate it, let's parse it after we've parsed a component.

Added some additional bad mangling tests, which are now rejected.

I don't break the 'T' and 'D[tT]' cases out of the loop, even though
they can only appear at first position, as it seems simpler to just
check there is nothing SoFar.

Reviewed By: ChuanqiXu

Differential Revision: https://reviews.llvm.org/D119542




More information about the All-commits mailing list