Jinoh Kang (@iamahuman) commented about server/thread.c:
{context_t *ctx = &thread->context->regs[CTX_NATIVE];flags = contexts[CTX_NATIVE].flags & ~native_flags;copy_context( ctx, &contexts[CTX_NATIVE], flags );ctx->flags |= flags; }
flags = context->flags;if (native_flags && ctx != CTX_NATIVE) /* some regs are always set from the native context */
if (is_pending || (ctx_count == 2 && thread->context->regs[CTX_WOW].machine)) {
copy_context( &thread->context->regs[CTX_NATIVE], &contexts[CTX_NATIVE], native_flags );thread->context->regs[CTX_NATIVE].flags |= native_flags;flags &= ~native_flags;
context_t *ctx = &thread->context->regs[CTX_WOW];flags = contexts[CTX_WOW].flags & ~native_flags;ctx->machine = contexts[CTX_WOW].machine;
Shouldn't we have already initialized `thread->context->regs[CTX_WOW]->machine` to `thread->process->machine` beforehand?