diff --git a/coctx.cpp b/coctx.cpp index 4d9a200..d5eeed1 100644 --- a/coctx.cpp +++ b/coctx.cpp @@ -108,8 +108,8 @@ int coctx_make(coctx_t* ctx, coctx_pfn_t pfn, const void* s, const void* s1) { } #elif defined(__x86_64__) int coctx_make(coctx_t* ctx, coctx_pfn_t pfn, const void* s, const void* s1) { - char* sp = ctx->ss_sp + ctx->ss_size; - sp = (char*)((unsigned long)sp & -16LL) - sizeof(void*); + char* sp = ctx->ss_sp + ctx->ss_size - sizeof(void*); + sp = (char*)((unsigned long)sp & -16LL); memset(ctx->regs, 0, sizeof(ctx->regs)); void** ret_addr = (void**)(sp);