File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -383,7 +383,9 @@ stmt::Ptr loop::convert_to_ast_impl(dominator_analysis &dta_, std::vector<std::p
383383 if (blocks_id_map.count (next_preorder))
384384 is_last_block = false ;
385385 else {
386- if (unique_exit_block && (next_preorder == (int )unique_exit_block->id ))
386+ if (!blocks_id_map.count (next_preorder) || !blocks_id_map.count (next_next_preorder))
387+ is_last_block = true ;
388+ else if (unique_exit_block && (next_preorder == (int )unique_exit_block->id ))
387389 is_last_block = true ;
388390 else if (unique_exit_block && (next_next_preorder == (int )unique_exit_block->id ))
389391 is_last_block = true ;
@@ -397,6 +399,7 @@ stmt::Ptr loop::convert_to_ast_impl(dominator_analysis &dta_, std::vector<std::p
397399 }
398400
399401 if (!is_last_block) {
402+ std::cerr << " inserted continue: " << bb->id << loop_id << " \n " ;
400403 ast->stmts .push_back (to<stmt>(std::make_shared<continue_stmt>()));
401404 while_block->continue_blocks .push_back (ast);
402405 }
You can’t perform that action at this time.
0 commit comments