diff mbox

[PULL,3/3] linux-user: fix broken cpu_copy()

Message ID 61c7480fa36775cc2baa2f8141f0c64a15f827b5.1427118794.git.riku.voipio@linaro.org
State Accepted
Commit 61c7480fa36775cc2baa2f8141f0c64a15f827b5
Headers show

Commit Message

Riku Voipio March 23, 2015, 1:54 p.m. UTC
From: Leon Alrae <leon.alrae@imgtec.com>

New threads always point at the same env which is incorrect and usually
leads to a crash.

Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
 linux-user/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/linux-user/main.c b/linux-user/main.c
index 31eb60f..a8adb04 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -3451,7 +3451,7 @@  CPUArchState *cpu_copy(CPUArchState *env)
 {
     CPUState *cpu = ENV_GET_CPU(env);
     CPUState *new_cpu = cpu_init(cpu_model);
-    CPUArchState *new_env = cpu->env_ptr;
+    CPUArchState *new_env = new_cpu->env_ptr;
     CPUBreakpoint *bp;
     CPUWatchpoint *wp;