Increase sp alignment to 16 bytes for safety

This commit is contained in:
Vladimir Serbinenko 2020-04-27 20:30:31 +02:00
parent e9b940de16
commit ad043c17f6

View file

@ -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;