Skip to content

Commit

Permalink
Increase sp alignment to 16 bytes for safety
Browse files Browse the repository at this point in the history
  • Loading branch information
phcoder committed Apr 27, 2020
1 parent e9b940d commit ad043c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libco/mips.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ cothread_t co_create(unsigned int size, void (*entrypoint)(void))
/* Non-volatiles. */
/* ptr[0],..., ptr[7] -> s0,..., s7 */
store_gp(&ptr[8]); /* gp */
ptr[9] = (uintptr_t)ptr + size - 8; /* sp */
ptr[9] = (uintptr_t)ptr + size - 16; /* sp */
/* ptr[10] is fp */
ptr[11] = (uintptr_t)entrypoint; /* ra */
return handle;
Expand Down

0 comments on commit ad043c1

Please sign in to comment.