Currently the swap stack instruction requires an exception clause, this makes no sense if the current_stack_clause is 'KILL_OLD'. I suggest making a minor change:
- If the current stack clause is 'KILL_OLD', require that the exception clause is absent (and have control flow analysis treat this instruction in the same was a thread_exit, I.e. it has no successor)
- Otherwise, require an exception clause
Also am I correct in assuming it's undefined behaviour to do a swap_stack/new_thread where the new stack clause is THROW_EXC but the last thing executed on the swappee was not a swap stack instruction with an exception clause?