[PATCH] D110268: [llvm-profgen] Fix a bug of assertion

Lei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 22 18:34:15 PDT 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc2be2d3284d2: [llvm-profgen] Fix a bug of assertion (authored by wlei).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110268

Files:
  llvm/tools/llvm-profgen/ProfiledBinary.cpp


Index: llvm/tools/llvm-profgen/ProfiledBinary.cpp
===================================================================
--- llvm/tools/llvm-profgen/ProfiledBinary.cpp
+++ llvm/tools/llvm-profgen/ProfiledBinary.cpp
@@ -219,11 +219,12 @@
     ContextVec.append(ExpandedContext);
   }
 
+  assert(ContextVec.size() && "Context length should be at least 1");
+
   // Compress the context string except for the leaf frame
   auto LeafFrame = ContextVec.back();
   LeafFrame.Callsite = LineLocation(0, 0);
   ContextVec.pop_back();
-  assert(ContextVec.size() && "Context length should be at least 1");
   CSProfileGenerator::compressRecursionContext(ContextVec);
   CSProfileGenerator::trimContext(ContextVec);
   ContextVec.push_back(LeafFrame);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110268.374413.patch
Type: text/x-patch
Size: 740 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210923/9634641d/attachment.bin>


More information about the llvm-commits mailing list