r600/sfn: Don't try to re-use iterators when the set is made empty

From Gert Wollny
c13de0509c43f9b9764dc939aa64fe70c6a80870 in mainline Mesa

fixes games/xonotic crash on r600 reported by edd@ on bugs@
This commit is contained in:
jsg
2023-12-01 07:56:04 +00:00
parent ccdae98fc7
commit 0eabb5c60c

View File

@@ -373,7 +373,11 @@ CopyPropFwdVisitor::visit(AluInstr *instr)
auto ii = dest->uses().begin();
auto ie = dest->uses().end();
while(ii != ie) {
/** libc++ seems to invalidate the end iterator too if a std::set is
* made empty by an erase operation,
* https://gitlab.freedesktop.org/mesa/mesa/-/issues/7931
*/
while(ii != ie && !dest->uses().empty()) {
auto i = *ii;
++ii;
/* SSA can always be propagated, registers only in the same block