diff --git a/gen_input/templates/interp/CORENAME.cpp.gtl b/gen_input/templates/interp/CORENAME.cpp.gtl index 26db3d0..119c084 100644 --- a/gen_input/templates/interp/CORENAME.cpp.gtl +++ b/gen_input/templates/interp/CORENAME.cpp.gtl @@ -181,6 +181,15 @@ protected: auto sign_mask = 1ULL<<(W-1); return (from & mask) | ((from & sign_mask) ? ~mask : 0); } + + inline void process_spawn_blocks() { + for(auto it = std::begin(spawn_blocks); it!=std::end(spawn_blocks);) + if(*it){ + (*it)(); + ++it; + } else + spawn_blocks.erase(it); + } <%functions.each{ it.eachLine { %> ${it}<%}%> <%}%> @@ -226,7 +235,7 @@ private: <%instr.behavior.eachLine{%>${it} <%}%>} catch(...){} // post execution stuff - for(auto& spawn_block:spawn_blocks) spawn_block(); + process_spawn_blocks(); if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, ${idx}); // trap check if(*trap_state!=0){