From 996eba9686d48b5816f9963859a8e15750c04288 Mon Sep 17 00:00:00 2001 From: Justin Viiret Date: Mon, 15 Feb 2016 12:35:03 +1100 Subject: [PATCH] Add CATCH_UP to report_block, not "parent" program Also ensure that exhaustion check happens after catch up, as catch up may fire reports (which could exhaust). --- src/rose/rose_build_bytecode.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/rose/rose_build_bytecode.cpp b/src/rose/rose_build_bytecode.cpp index 558603f7..5354955a 100644 --- a/src/rose/rose_build_bytecode.cpp +++ b/src/rose/rose_build_bytecode.cpp @@ -3035,15 +3035,6 @@ void makeReport(RoseBuildImpl &build, const ReportID id, const bool has_som, vector report_block; - // If this report has an exhaustion key, we can check it in the program - // rather than waiting until we're in the callback adaptor. - if (report.ekey != INVALID_EKEY) { - auto ri = RoseInstruction(ROSE_INSTR_CHECK_EXHAUSTED, - JumpTarget::NEXT_BLOCK); - ri.u.checkExhausted.ekey = report.ekey; - report_block.push_back(move(ri)); - } - // Similarly, we can handle min/max offset checks. if (report.minOffset > 0 || report.maxOffset < MAX_OFFSET) { auto ri = RoseInstruction(ROSE_INSTR_CHECK_BOUNDS, @@ -3057,7 +3048,16 @@ void makeReport(RoseBuildImpl &build, const ReportID id, const bool has_som, // TODO: this could be floated in front of all the reports and only done // once. if (report.type != INTERNAL_ROSE_CHAIN) { - program.emplace_back(ROSE_INSTR_CATCH_UP); + report_block.emplace_back(ROSE_INSTR_CATCH_UP); + } + + // If this report has an exhaustion key, we can check it in the program + // rather than waiting until we're in the callback adaptor. + if (report.ekey != INVALID_EKEY) { + auto ri = RoseInstruction(ROSE_INSTR_CHECK_EXHAUSTED, + JumpTarget::NEXT_BLOCK); + ri.u.checkExhausted.ekey = report.ekey; + report_block.push_back(move(ri)); } // External SOM reports need their SOM value calculated.