Skip to content

Commit 400c98e

Browse files
committed
Increase sp alignment to 16 bytes for safety
1 parent 7920831 commit 400c98e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libco/mips.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ cothread_t co_create(unsigned int size, void (*entrypoint)(void))
214214
/* Non-volatiles. */
215215
/* ptr[0],..., ptr[7] -> s0,..., s7 */
216216
store_gp(&ptr[8]); /* gp */
217-
ptr[9] = (uintptr_t)ptr + size - 8; /* sp */
217+
ptr[9] = (uintptr_t)ptr + size - 16; /* sp */
218218
/* ptr[10] is fp */
219219
ptr[11] = (uintptr_t)entrypoint; /* ra */
220220
return handle;

0 commit comments

Comments
 (0)