Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion arch/sim/src/sim/sim_vfork.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <errno.h>
#include <debug.h>

#include <nuttx/compiler.h>
#include <nuttx/sched.h>
#include <nuttx/arch.h>
#include <arch/irq.h>
Expand Down Expand Up @@ -82,10 +83,15 @@
*
****************************************************************************/

#ifdef CONFIG_SIM_ASAN
nosanitize_address
#endif
Comment thread
xiaoxiang781216 marked this conversation as resolved.
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;
Expand Down Expand Up @@ -130,7 +136,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? */

Expand Down