Merge pull request #584 from Nukem9/patch-2
Invalid iterator in control_flow_simplification_pass
This commit is contained in:
commit
fd397a8576
|
@ -20,7 +20,7 @@ bool ControlFlowSimplificationPass::Run(spv::Module* module) {
|
|||
// Walk through the blocks in the function and merge any blocks which are
|
||||
// unconditionally dominated.
|
||||
for (auto it = function->getBlocks().end() - 1;
|
||||
it != function->getBlocks().begin() - 1;) {
|
||||
it != function->getBlocks().begin();) {
|
||||
auto block = *it;
|
||||
if (!block->isUnreachable() && block->getPredecessors().size() == 1) {
|
||||
auto prev_block = block->getPredecessors()[0];
|
||||
|
@ -45,4 +45,4 @@ bool ControlFlowSimplificationPass::Run(spv::Module* module) {
|
|||
|
||||
} // namespace spirv
|
||||
} // namespace gpu
|
||||
} // namespace xe
|
||||
} // namespace xe
|
||||
|
|
Loading…
Reference in New Issue