Merge pull request #584 from Nukem9/patch-2

Invalid iterator in control_flow_simplification_pass
This commit is contained in:
Justin Moore 2016-06-18 16:12:13 -05:00 committed by GitHub
commit fd397a8576
1 changed files with 2 additions and 2 deletions

View File

@ -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