sim: fix sim runtime err under sanitize check mode.

since gcc sanitize can not stub proper code in nuttx kernel code.

Change-Id: I0910bddee71538c202c6a0a8faab76bcc65f5cd2
This commit is contained in:
mage1
2021-03-17 15:41:18 +08:00
parent 1dac6f93fd
commit f6a4c17838
+5 -1
View File
@@ -89,6 +89,8 @@ pid_t up_vfork(const xcpt_reg_t *context)
{
struct tcb_s *parent = this_task();
struct task_tcb_s *child;
unsigned char *pout;
unsigned char *pin;
xcpt_reg_t newsp;
xcpt_reg_t newfp;
xcpt_reg_t newtop;
@@ -133,7 +135,9 @@ pid_t up_vfork(const xcpt_reg_t *context)
newtop = (xcpt_reg_t)child->cmn.stack_base_ptr +
child->cmn.adj_stack_size;
newsp = newtop - stackutil;
memcpy((void *)newsp, (const void *)context[JB_SP], stackutil);
pout = (unsigned char *)newsp;
pin = (unsigned char *)context[JB_SP];
while (stackutil-- > 0) *pout++ = *pin++;
/* Was there a frame pointer in place before? */