From 7ef69fea470eb3347968e76fbb28f19d8618a45f Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 22 May 2019 08:51:51 -0600 Subject: [PATCH] arch/mips/src/mips32/up_vfork.c: Fix a copy-paste error. On vfork, the GP register was being set to the new SP value vs. the context GP value. NOTED in Bitbucket issue 155. --- arch/mips/src/mips32/up_vfork.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/src/mips32/up_vfork.c b/arch/mips/src/mips32/up_vfork.c index dacad2c460..6f1616fb9d 100644 --- a/arch/mips/src/mips32/up_vfork.c +++ b/arch/mips/src/mips32/up_vfork.c @@ -251,7 +251,7 @@ pid_t up_vfork(const struct vfork_s *context) #endif child->cmn.xcp.regs[REG_SP] = newsp; /* Stack pointer */ #ifdef MIPS32_SAVE_GP - child->cmn.xcp.regs[REG_GP] = newsp; /* Global pointer */ + child->cmn.xcp.regs[REG_GP] = context->gp; /* Global pointer */ #endif /* And, finally, start the child task. On a failure, nxtask_vforkstart()