Received: from eggs.gnu.org ([2001:4830:134:3::10]:36909) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRjiX-0002fs-2f for qemu-devel@nongnu.org; Thu, 03 Oct 2013 10:17:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VRjiS-0002EL-7X for qemu-devel@nongnu.org; Thu, 03 Oct 2013 10:17:25 -0400 Received: from gelbbaer.kn-bremen.de ([78.46.108.116]:45460 helo=smtp.kn-bremen.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRjiS-0002Dp-1C for qemu-devel@nongnu.org; Thu, 03 Oct 2013 10:17:20 -0400 From: Juergen Lock Date: Thu, 3 Oct 2013 16:09:37 +0200 Message-ID: <20131003140937.GA59761@enceladus10.kn-bremen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH] cpu-exec(): also reload CPUClass *cc after longjmp return List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Jan Kiszka , Dimitry Andric , Andreas Faerber Local variable CPUClass *cc needs to be reloaded after return from longjmp too. (This fixes the mips-softmmu crash observed on FreeBSD when qemu is built with clang.) Signed-off-by: Juergen Lock Found-by: Dimitry Andric --- a/cpu-exec.c +++ b/cpu-exec.c @@ -681,6 +681,10 @@ int cpu_exec(CPUArchState *env) * local variables as longjmp is marked 'noreturn'. */ cpu = current_cpu; env = cpu->env_ptr; +#if !(defined(CONFIG_USER_ONLY) && \ + (defined(TARGET_M68K) || defined(TARGET_PPC) || defined(TARGET_S390X))) + cc = CPU_GET_CLASS(cpu); +#endif } } /* for(;;) */