[all-commits] [llvm/llvm-project] c193bb: [Coverage] getMaxBitmapSize: Scan `max(BitmapIdx)`...

NAKAMURA Takumi via All-commits all-commits at lists.llvm.org
Tue Jan 23 00:59:56 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c193bb7e9eee02a435944506c732db9b480f0c84
      https://github.com/llvm/llvm-project/commit/c193bb7e9eee02a435944506c732db9b480f0c84
  Author: NAKAMURA Takumi <geek4civic at gmail.com>
  Date:   2024-01-23 (Tue, 23 Jan 2024)

  Changed paths:
    M llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
    A llvm/test/tools/llvm-cov/Inputs/mcdc-maxbs.c
    A llvm/test/tools/llvm-cov/Inputs/mcdc-maxbs.o
    A llvm/test/tools/llvm-cov/Inputs/mcdc-maxbs.proftext
    A llvm/test/tools/llvm-cov/mcdc-maxbs.test

  Log Message:
  -----------
  [Coverage] getMaxBitmapSize: Scan `max(BitmapIdx)` instead of the last `Decision` (#78963)

In `CoverageMapping.cpp:getMaxBitmapSize()`, 
this assumed that the last `Decision` has the maxmum `BitmapIdx`.

Let it scan `max(BitmapIdx)`.

Note that `<=` is used insted of `<`, because `BitmapIdx == 0` is valid
and `MaxBitmapID` is `unsigned`. `BitmapIdx` is unique in the record.

Fixes #78922




More information about the All-commits mailing list