[PATCH] D51003: Allow demangler's node allocator to fail, and bail out of the entire demangling process when it does. Use this to support a "lookup" query for the mangling canonicalizer that does not create new nodes.

Richard Smith - zygoloid via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 24 15:48:45 PDT 2018


rsmith marked 4 inline comments as done.
rsmith added inline comments.


================
Comment at: include/llvm/Demangle/ItaniumDemangle.h:2905-2915
     //          ::= <substitution>
     if (look() == 'S' && look(1) != 't') {
       Node *S = parseSubstitution();
       if (S == nullptr)
         return nullptr;
-      PushComponent(S);
+      if (!PushComponent(S))
+        return nullptr;
----------------
Incidentally: this doesn't look quite right to me. A <substitution> can only appear at the start of a <prefix>, right? (We should presumably parse this before the loop, like we do for `St`.)


Repository:
  rL LLVM

https://reviews.llvm.org/D51003





More information about the llvm-commits mailing list