[SanitizerCoverage] Fix wrong pointer type return from CreateSecStartEnd()
authorWu, Yingcong <yingcong.wu@intel.com>
Thu, 10 Nov 2022 07:29:04 +0000 (23:29 -0800)
committerFangrui Song <i@maskray.me>
Thu, 10 Nov 2022 07:29:04 +0000 (23:29 -0800)
commit7f07c4d5134e32787e89ff1d8e6f7a680a40dbd8
tree635e6f7c2810476f5f5242d7f9be5cc60a4b589e
parentdd9f7963e434a53e8d70f607392ee9abf76f1d99
[SanitizerCoverage] Fix wrong pointer type return from CreateSecStartEnd()

`CreateSecStartEnd()` will return pointer to the input type, so when called with `CreateSecStartEnd(M, SanCovCFsSectionName, IntptrPtrTy)`, `SecStartEnd.first` and `SecStartEnd.second` will have type `IntptrPtrPtrTy`, not `IntptrPtrTy`.

This problem should not impact the functionality and with opaque pointer enable, this will not trigger any alarm. But if runs with `-no-opaque-pointers`, this mismatch pointer type will cause type check assertion in `CallInst::init()` to fail.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D137310
llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp