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++.
Differential D159177
[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 TimelineThis revision is now accepted and ready to land.Aug 30 2023, 9:47 AM Closed by commit rG9c99e9fd684f: [BOLT] Fix a bug related to iterators in ReorderData pass (authored by sinan, committed by 杨桃 <linsinan.lsn@alibaba-inc.com>). · Explain WhyAug 30 2023, 8:16 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 554890 bolt/lib/Passes/ReorderData.cpp
|