aboutsummaryrefslogtreecommitdiff
path: root/target-sparc/translate.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-11-21 23:33:12 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-11-21 23:33:12 +0000
commitc68ea7043f2ed4c631d1e3a4f35afe247d5ca063 (patch)
tree64b42bfd3fe62caf019e384cee26e80b98da831d /target-sparc/translate.c
parent173d6cfe5129301a3a8f2570223aaa47a815f343 (diff)
cpu_single_env usage fix
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1644 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-sparc/translate.c')
-rw-r--r--target-sparc/translate.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index 6340e15225..8a8620fcf2 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -2672,11 +2672,10 @@ CPUSPARCState *cpu_sparc_init(void)
{
CPUSPARCState *env;
- cpu_exec_init();
-
- if (!(env = malloc(sizeof(CPUSPARCState))))
- return (NULL);
- cpu_single_env = env;
+ env = qemu_mallocz(sizeof(CPUSPARCState));
+ if (!env)
+ return NULL;
+ cpu_exec_init(env);
cpu_reset(env);
return (env);
}