[PATCH] D110271: [llvm-profgen] Fix an out-of-range error during unwinding

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 22 10:46:20 PDT 2021


wenlei added inline comments.


================
Comment at: llvm/tools/llvm-profgen/PerfReader.cpp:65
     uint64_t LeafAddr = State.CurrentLeafFrame->Address;
-    while (IP.Address >= Target) {
+    while (IP.Address >= Target && IP.Index != 0) {
       uint64_t PrevIP = IP.Address;
----------------
Why do we run into such cases? Is the profile corrupted? If that's the case, it may make sense to emit a warning about corrupted profile.

As for the check itself, how about fold it into advance/backward, and let them return a boolean for caller to check? Index is implementation details of InstructionPoint and would be good to avoid using it from outside.  


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110271



More information about the llvm-commits mailing list