This is an archive of the discontinued LLVM Phabricator instance.

[Coverage] Ensure that coverage mapping data has an expected alignment in 'covmapping' files.
ClosedPublic

Authored by ikudrin on May 16 2016, 7:18 AM.

Details

Summary

Coverage mapping data is organized in a sequence of blocks, each of which is expected
to be aligned by 8 bytes. This feature is used when reading those blocks, see
VersionedCovMapFuncRecordReader::readFunctionRecords(). If a misaligned covearge
mapping data has more than one block, it causes llvm-cov to fail.

Diff Detail

Event Timeline

ikudrin updated this revision to Diff 57341.May 16 2016, 7:18 AM
ikudrin retitled this revision from to [Coverage] Ensure that coverage mapping data has an expected alignment in 'covmapping' files..
ikudrin updated this object.
ikudrin added reviewers: bogner, davidxl, vsk.
ikudrin added a subscriber: llvm-commits.
vsk accepted this revision.May 16 2016, 8:21 AM
vsk edited edge metadata.

This lgtm with a nit.

lib/ProfileData/Coverage/CoverageMappingReader.cpp
496

Could you use the truncated error for this (to match line 475)?

This revision is now accepted and ready to land.May 16 2016, 8:21 AM
This revision was automatically updated to reflect the committed changes.