diff --git a/runtime/include/arch/aarch64/context.h b/runtime/include/arch/aarch64/context.h index 067a7d4..a03a233 100644 --- a/runtime/include/arch/aarch64/context.h +++ b/runtime/include/arch/aarch64/context.h @@ -15,6 +15,8 @@ static inline void arch_context_init(struct arch_context *actx, reg_t ip, reg_t sp) { + assert(actx->variant == arch_context_unused); + memset(&actx->mctx, 0, sizeof(mcontext_t)); memset((void *)actx->regs, 0, sizeof(reg_t) * ureg_count); diff --git a/runtime/include/arch/x86_64/context.h b/runtime/include/arch/x86_64/context.h index 5a0857c..95bbbf4 100644 --- a/runtime/include/arch/x86_64/context.h +++ b/runtime/include/arch/x86_64/context.h @@ -72,7 +72,7 @@ arch_context_switch(struct arch_context *current, struct arch_context *next) if (next == NULL) next = &worker_thread_base_context; /* Assumption: The context we are switching to should have saved a context in some form */ - assert(next->variant == arch_context_fast || next->variant != arch_context_unused); + assert(next->variant == arch_context_fast || next->variant == arch_context_slow); reg_t *current_registers = current->regs, *next_registers = next->regs; assert(current_registers && next_registers);