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
@@ -319,7 +319,7 @@ template <> struct GraphTraits<StackPromoter *>
|
||||
return nodes_iterator(SP->getFunction()->end(), SP->getFunction()->end());
|
||||
}
|
||||
static unsigned size(GraphType SP) {
|
||||
return std::distance(nodes_begin(SP), nodes_end(SP));
|
||||
return std::distance(SP->getFunction()->begin(), SP->getFunction()->end());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user