mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SIL: Avoid dereferencing sentinel nodes in ilist_iterators
The behaviour of ilist has changed in LLVM. It is no longer permissible to dereference the `end()` value. Add a check to ensure that we do not accidentally dereference the iterator.
This commit is contained in:
committed by
Saleem Abdulrasool
parent
7d1da2af3d
commit
66dcad0d34
@@ -130,8 +130,7 @@ SILGenFunction::emitEpilogBB(SILLocation TopLevel) {
|
||||
B.setInsertionPoint(pred);
|
||||
} else {
|
||||
// Move the epilog block to the end of the ordinary section.
|
||||
auto endOfOrdinarySection =
|
||||
(StartOfPostmatter ? SILFunction::iterator(StartOfPostmatter) : F.end());
|
||||
auto endOfOrdinarySection = StartOfPostmatter;
|
||||
B.moveBlockTo(epilogBB, endOfOrdinarySection);
|
||||
|
||||
// Emit the epilog into the epilog bb. Its arguments are the
|
||||
|
||||
Reference in New Issue
Block a user