From 613ed72ee55266f9853cec30151acad500334345 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Mon, 6 Jul 2020 09:29:43 -0400 Subject: [PATCH] chore: flatten x64 mcontext restore else --- runtime/include/arch/x86_64/context.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/runtime/include/arch/x86_64/context.h b/runtime/include/arch/x86_64/context.h index 4e763c6..523b666 100644 --- a/runtime/include/arch/x86_64/context.h +++ b/runtime/include/arch/x86_64/context.h @@ -94,13 +94,15 @@ arch_mcontext_restore(mcontext_t *mc, arch_context_t *ctx) mc->gregs[REG_RSP] = ctx->regs[5]; mc->gregs[REG_RIP] = ctx->regs[16] + ARCH_SIG_JMP_OFF; ctx->regs[5] = 0; + return 1; - } else { - /* Restore mcontext */ - memcpy(mc, &ctx->mctx, sizeof(mcontext_t)); - memset(&ctx->mctx, 0, sizeof(mcontext_t)); - return 0; } + + /* Restore mcontext */ + memcpy(mc, &ctx->mctx, sizeof(mcontext_t)); + memset(&ctx->mctx, 0, sizeof(mcontext_t)); + + return 0; } /**