From 809c7134fefe73605851a2810dfc12b7a8fa01dd Mon Sep 17 00:00:00 2001 From: Vern Paxson Date: Sat, 15 Jun 2024 10:21:55 -0700 Subject: [PATCH] fixup for loop body control flow --- src/script_opt/ZAM/Stmt.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/script_opt/ZAM/Stmt.cc b/src/script_opt/ZAM/Stmt.cc index 38e43f7711..8789447c45 100644 --- a/src/script_opt/ZAM/Stmt.cc +++ b/src/script_opt/ZAM/Stmt.cc @@ -936,6 +936,7 @@ const ZAMStmt ZAMCompiler::FinishLoop(const ZAMStmt iter_head, ZInstI& iter_stmt bool is_table) { auto loop_iter = AddInst(iter_stmt); auto body_end = CompileStmt(body); + AddCFT(insts1[body_end.stmt_num], CFT_BLOCK_END); // We only need cleanup for looping over tables, but for now we // need some sort of placeholder instruction (until the optimizer @@ -958,8 +959,6 @@ const ZAMStmt ZAMCompiler::FinishLoop(const ZAMStmt iter_head, ZInstI& iter_stmt ResolveNexts(GoToTarget(iter_head)); ResolveBreaks(GoToTarget(final_stmt)); - AddCFT(&z, CFT_BLOCK_END); - return final_stmt; }