VERY experimental Nintendo Switch 2 emulator
C++
shader: Fix dangling labels
ReinUsesLisp7f758182988a
diff --git a/src/shader_recompiler/frontend/maxwell/control_flow.cpp b/src/shader_recompiler/frontend/maxwell/control_flow.cppindex 1a4ee4f6cb..847bb19864 100644--- a/src/shader_recompiler/frontend/maxwell/control_flow.cpp+++ b/src/shader_recompiler/frontend/maxwell/control_flow.cpp@@ -518,6 +518,11 @@ Block* CFG::AddLabel(Block* block, Stack stack, Location pc, FunctionId function}return &*it;}+ // Make sure we don't insert the same layer twice+ const auto label_it{std::ranges::find(function.labels, pc, &Label::address)};+ if (label_it != function.labels.end()) {+ return label_it->block;+ }Block* const new_block{block_pool.Create(Block{.begin{pc},.end{pc},