[PATCH] D101780: [CoverageMapping] Handle gaps in counter IDs for source-based coverage

Pirama Arumuga Nainar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 17 15:11:29 PDT 2021


pirama added a comment.

Thanks for the detail about the edge counters @richkadel.



================
Comment at: llvm/lib/ProfileData/Coverage/CoverageMapping.cpp:196
+  case Counter::Expression: {
+    if (C.getExpressionID() >= Expressions.size())
+      return 0;
----------------
vsk wrote:
> I'm not sure how this case can arise. Would it be preferable to assert C.getExpressionID() < Expressions.size() instead?
I mirrorred `CounterMappingContext::evaluate()` above, which implies this case could happen.  Not sure if an assert is needed here since `evaluate()` would report an error anyway.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101780



More information about the llvm-commits mailing list