This is an archive of the discontinued LLVM Phabricator instance.

[llvm-profgen] Use shared pointer to fix memory leak issue from asan
AbandonedPublic

Authored by wlei on Aug 17 2021, 3:19 PM.

Details

Reviewers
hoy
wenlei
Summary

As titled.

Diff Detail

Unit TestsFailed

Event Timeline

wlei created this revision.Aug 17 2021, 3:19 PM
wlei requested review of this revision.Aug 17 2021, 3:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 17 2021, 3:19 PM
wlei edited the summary of this revision. (Show Details)Aug 17 2021, 3:22 PM
wlei added reviewers: hoy, wenlei.
wlei abandoned this revision.Aug 17 2021, 3:38 PM
hoy added inline comments.Aug 17 2021, 3:39 PM
llvm/tools/llvm-profgen/PerfReader.cpp
299

I think you can use unique_ptr here. Everywhere else consuming the binary can use the raw pointer, until PerfReaderBase is deleted.

wlei added inline comments.Aug 17 2021, 3:41 PM
llvm/tools/llvm-profgen/PerfReader.cpp
299

Yeah, just realized this, thanks!