[PATCH] D142101: [clang] [extract-api] Don't crash for category in libclang APIs

Ben Barham via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 19 11:20:01 PST 2023


bnbarham accepted this revision.
bnbarham added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp:537-544
+  generatePathComponents(Record, API,
+                         [Lang, &ParentContexts](const PathComponent &PC) {
+                           ParentContexts.push_back(
+                               serializeParentContext(PC, Lang));
+                         });
+
+  // The last component would be the record itself so let's remove it.
----------------
It's not really clear to me what the intended behavior was meant to be here, ie. whether if any parent fails we skip writing all *or* if we should be writing all valid parents. I'll leave that to someone that knows more about the symbolgraph output.

But this fixes the obvious crash, so that part is fine with me.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142101/new/

https://reviews.llvm.org/D142101



More information about the cfe-commits mailing list