Skip to content

Commit 58651e9

Browse files
author
princewen
committed
Make stack sp aligned
1 parent c79e3e8 commit 58651e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

coctx.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ int coctx_make(coctx_t* ctx, coctx_pfn_t pfn, const void* s, const void* s1) {
108108
}
109109
#elif defined(__x86_64__)
110110
int coctx_make(coctx_t* ctx, coctx_pfn_t pfn, const void* s, const void* s1) {
111-
char* sp = ctx->ss_sp + ctx->ss_size;
112-
sp = (char*)((unsigned long)sp & -16LL) - sizeof(void*);
111+
char* sp = ctx->ss_sp + ctx->ss_size - sizeof(void*);
112+
sp = (char*)((unsigned long)sp & -16LL);
113113

114114
memset(ctx->regs, 0, sizeof(ctx->regs));
115115
void** ret_addr = (void**)(sp);

0 commit comments

Comments
 (0)