This is an archive of the discontinued LLVM Phabricator instance.

[BOLT] Fix a bug related to iterators in ReorderData pass
ClosedPublic

Authored by sinan on Aug 30 2023, 1:17 AM.

Details

Summary

If Itr is the last element then std::next(Itr) will be Range.end(), so that the statement std::next(Itr)->second is a UB.

I encountered a segmentation fault in test "reorder-data-writable-ptload.c" with my llvm-bolt linked against static libc++.

Diff Detail

Event Timeline

sinan created this revision.Aug 30 2023, 1:17 AM
Herald added a project: Restricted Project. · View Herald Transcript
sinan requested review of this revision.Aug 30 2023, 1:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 30 2023, 1:17 AM
yota9 accepted this revision.Aug 30 2023, 9:47 AM

LGTM thanks!

This revision is now accepted and ready to land.Aug 30 2023, 9:47 AM
maksfb accepted this revision.Aug 30 2023, 11:03 AM