mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-11-11 16:54:58 +00:00
shader: Fix dangling labels
This commit is contained in:
parent
e9a91bc5cc
commit
233e39bb7b
1 changed files with 5 additions and 0 deletions
|
@ -518,6 +518,11 @@ Block* CFG::AddLabel(Block* block, Stack stack, Location pc, FunctionId function
|
||||||
}
|
}
|
||||||
return &*it;
|
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{
|
Block* const new_block{block_pool.Create(Block{
|
||||||
.begin{pc},
|
.begin{pc},
|
||||||
.end{pc},
|
.end{pc},
|
||||||
|
|
Loading…
Reference in a new issue