提交 696da41b 编写于 作者: E Eduardo Habkost

linux-user: Check for cpu_init() errors

This was the only caller of cpu_init() that was not checking for NULL
yet.
Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
上级 9e9d3863
......@@ -3453,10 +3453,17 @@ CPUArchState *cpu_copy(CPUArchState *env)
{
CPUState *cpu = ENV_GET_CPU(env);
CPUArchState *new_env = cpu_init(cpu_model);
CPUState *new_cpu = ENV_GET_CPU(new_env);
CPUState *new_cpu;
CPUBreakpoint *bp;
CPUWatchpoint *wp;
if (!new_env) {
fprintf(stderr, "cpu_copy: Failed to create new CPU\n");
exit(1);
}
new_cpu = ENV_GET_CPU(new_env);
/* Reset non arch specific state */
cpu_reset(new_cpu);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册