mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-07 21:20:18 +00:00
CodeGenSchedule: smallvector.push_back(smallvector[0]) is dangerous
The element passed to push_back is not copied before the vector reallocates. The client needs to copy the element first before passing it to push_back. No test case, will be tested by follow-up swift scheduler model change (it segfaults without this change). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183459 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
81c5d11c25
commit
45dc03287e
@ -1172,7 +1172,9 @@ pushVariant(const TransVariant &VInfo, bool IsRead) {
|
||||
unsigned OperIdx = RWSequences.size()-1;
|
||||
// Make N-1 copies of this transition's last sequence.
|
||||
for (unsigned i = 1, e = SelectedRWs.size(); i != e; ++i) {
|
||||
RWSequences.push_back(RWSequences[OperIdx]);
|
||||
// Create a temporary copy the vector could reallocate.
|
||||
SmallVector<unsigned, 4> Tmp = RWSequences[OperIdx];
|
||||
RWSequences.push_back(Tmp);
|
||||
}
|
||||
// Push each of the N elements of the SelectedRWs onto a copy of the last
|
||||
// sequence (split the current operand into N operands).
|
||||
|
Loading…
x
Reference in New Issue
Block a user