diff options
Diffstat (limited to 'src/shader_recompiler/frontend/maxwell')
| -rw-r--r-- | src/shader_recompiler/frontend/maxwell/control_flow.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/control_flow.cpp b/src/shader_recompiler/frontend/maxwell/control_flow.cpp index 1a4ee4f6c..847bb1986 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 | |||
| 518 | } | 518 | } |
| 519 | return &*it; | 519 | return &*it; |
| 520 | } | 520 | } |
| 521 | // Make sure we don't insert the same layer twice | ||
| 522 | const auto label_it{std::ranges::find(function.labels, pc, &Label::address)}; | ||
| 523 | if (label_it != function.labels.end()) { | ||
| 524 | return label_it->block; | ||
| 525 | } | ||
| 521 | Block* const new_block{block_pool.Create(Block{ | 526 | Block* const new_block{block_pool.Create(Block{ |
| 522 | .begin{pc}, | 527 | .begin{pc}, |
| 523 | .end{pc}, | 528 | .end{pc}, |