]> granicus.if.org Git - llvm/commit
[InstrProf] Tighten a check for malformed data records in raw profiles
authorVedant Kumar <vsk@apple.com>
Tue, 3 Sep 2019 22:23:14 +0000 (22:23 +0000)
committerVedant Kumar <vsk@apple.com>
Tue, 3 Sep 2019 22:23:14 +0000 (22:23 +0000)
commit1ae7a2beeafc9371bc0e397647398f6e635d595e
tree68e94c3d3162a0707ef48006cb8f77d7be55c507
parent074bcc7643487853df21590c47c971215a31cdeb
[InstrProf] Tighten a check for malformed data records in raw profiles

The check needs to validate a counter offset before performing pointer
arithmetic with the (potentially corrupt) offset.

Found by UBSan's pointer overflow check.

rdar://54843625

Differential Revision: https://reviews.llvm.org/D66979

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370826 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ProfileData/InstrProfReader.h
lib/ProfileData/InstrProfReader.cpp
test/tools/llvm-profdata/Inputs/malformed-ptr-to-counter-array.profraw [new file with mode: 0644]
test/tools/llvm-profdata/malformed-ptr-to-counter-array.test [new file with mode: 0644]