[llvm] [llvm-profgen][NFC] Fix dereference of empty function range when --disassemble-functions for symbols with no range (PR #219117)

via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 00:14:57 PDT 2026


================
@@ -501,9 +500,11 @@ void ProfiledBinary::decodePseudoProbe(const ObjectFile *Obj) {
         auto GUID = Function::getGUIDAssumingExternalLinkage(F.first());
         if (auto StartAddr = SymbolStartAddrs.lookup(GUID)) {
           FuncStartAddresses[GUID] = StartAddr;
-          FuncRange &Range = StartAddrToFuncRangeMap[StartAddr];
-          GuidFilter.insert(
-              Function::getGUIDAssumingExternalLinkage(Range.getFuncName()));
+          if (FuncRange *Range = findFuncRangeForStartAddr(StartAddr))
+            GuidFilter.insert(
+                Function::getGUIDAssumingExternalLinkage(Range->getFuncName()));
+          else
+            GuidFilter.insert(GUID);
----------------
zhangweize9-cyber wrote:

Strictly speaking, this is not a non-functional change, it's a fix that requires additional unit tests.

Please provide a unit test case that triggers the `GuidFilter.insert(GUID);` branch.

https://github.com/llvm/llvm-project/pull/219117


More information about the llvm-commits mailing list