aboutsummaryrefslogtreecommitdiff
path: root/linux-user/main.c
diff options
context:
space:
mode:
authorLeon Alrae <leon.alrae@imgtec.com>2015-03-23 12:55:52 +0000
committerRiku Voipio <riku.voipio@linaro.org>2015-03-23 15:26:42 +0200
commit61c7480fa36775cc2baa2f8141f0c64a15f827b5 (patch)
treead612b539bc493d57b0a9cd6844c332a02005c0d /linux-user/main.c
parent17644b362746c400f45b0d2b0a3ce8a52fed13fb (diff)
linux-user: fix broken cpu_copy()
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>
Diffstat (limited to 'linux-user/main.c')
-rw-r--r--linux-user/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/linux-user/main.c b/linux-user/main.c
index 31eb60f62b..a8adb0404b 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;