[PATCH] D108942: [compiler-rt] Add more diagnostic to InstrProfError

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 26 10:17:23 PDT 2021


phosek added inline comments.


================
Comment at: llvm/lib/ProfileData/InstrProfReader.cpp:462
       ((uint32_t)CounterOffset + NumCounters) > (uint32_t)MaxNumCounters)
-    return error(instrprof_error::malformed);
+    return error(instrprof_error::malformed, "counter offset is invalid");
 
----------------
phosek wrote:
> 
Actually here it could be either the counter offset that's out of bounds, or the number of counters that's out of bounds, so perhaps we should split this into two separate checks.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108942



More information about the llvm-commits mailing list