From 61c7480fa36775cc2baa2f8141f0c64a15f827b5 Mon Sep 17 00:00:00 2001 From: Leon Alrae Date: Mon, 23 Mar 2015 12:55:52 +0000 Subject: linux-user: fix broken cpu_copy() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New threads always point at the same env which is incorrect and usually leads to a crash. Signed-off-by: Leon Alrae Reviewed-by: Andreas Färber Signed-off-by: Riku Voipio --- linux-user/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux-user') 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; -- cgit v1.2.1