| 45 | } |
| 46 | |
| 47 | void CommandQueue::rationalizeQueue(MICommand* command) |
| 48 | { |
| 49 | if ((command->type() >= ExecAbort && command->type() <= ExecUntil) && |
| 50 | command->type() != ExecArguments ) { |
| 51 | // Changing execution location, abort any variable updates and stack list updates |
| 52 | |
| 53 | auto predicate = [this](const auto& command) { |
| 54 | const auto type = command->type(); |
| 55 | const auto isVariableUpdate |
| 56 | = (type >= VarEvaluateExpression && type <= VarListChildren) || type == VarUpdate; |
| 57 | const auto isStackListUpdate = type >= StackListArguments && type <= StackListLocals; |
| 58 | if (isVariableUpdate || isStackListUpdate) { |
| 59 | if (command->flags() & (CmdImmediately | CmdInterrupt)) |
| 60 | --m_immediatelyCounter; |
| 61 | return true; |
| 62 | } |
| 63 | return false; |
| 64 | }; |
| 65 | m_commandList.erase(std::remove_if(m_commandList.begin(), m_commandList.end(), predicate), m_commandList.end()); |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | void CommandQueue::clear() |
| 70 | { |