Invalid iterator in control_flow_simplification_pass
This commit is contained in:
@@ -20,7 +20,7 @@ bool ControlFlowSimplificationPass::Run(spv::Module* module) {
|
|||||||
// Walk through the blocks in the function and merge any blocks which are
|
// Walk through the blocks in the function and merge any blocks which are
|
||||||
// unconditionally dominated.
|
// unconditionally dominated.
|
||||||
for (auto it = function->getBlocks().end() - 1;
|
for (auto it = function->getBlocks().end() - 1;
|
||||||
it != function->getBlocks().begin() - 1;) {
|
it != function->getBlocks().begin();) {
|
||||||
auto block = *it;
|
auto block = *it;
|
||||||
if (!block->isUnreachable() && block->getPredecessors().size() == 1) {
|
if (!block->isUnreachable() && block->getPredecessors().size() == 1) {
|
||||||
auto prev_block = block->getPredecessors()[0];
|
auto prev_block = block->getPredecessors()[0];
|
||||||
|
|||||||
Reference in New Issue
Block a user