xtensa/asm2: Don't return into dead threads

It's not impossible that something we just handled (e.g. a machine
exception) called k_thread_abort() on our current thread.  Don't try
to return into it, check the DEAD state.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
Andy Ross 2018-02-08 16:05:03 -08:00 committed by Anas Nashif
commit 0244d01fda

View file

@ -140,7 +140,8 @@ static void dump_stack(int *stack)
#if CONFIG_XTENSA_ASM2
static inline void *restore_stack(void *interrupted_stack)
{
if (!_is_preempt(_current)) {
if (!_is_preempt(_current) &&
!(_current->base.thread_state & _THREAD_DEAD)) {
return interrupted_stack;
}