Skip to content

Commit

Permalink
target-m68k: Catch attempt to instantiate abstract type in cpu_init()
Browse files Browse the repository at this point in the history
This fixes -cpu m68k-cpu asserting.

Cc: qemu-stable@nongnu.org
Signed-off-by: Andreas Färber <afaerber@suse.de>
  • Loading branch information
afaerber committed Jan 27, 2013
1 parent 245fb54 commit cae8506
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion target-m68k/cpu.c
Expand Up @@ -64,7 +64,8 @@ static ObjectClass *m68k_cpu_class_by_name(const char *cpu_model)
}

oc = object_class_by_name(cpu_model);
if (oc != NULL && object_class_dynamic_cast(oc, TYPE_M68K_CPU) == NULL) {
if (oc != NULL && (object_class_dynamic_cast(oc, TYPE_M68K_CPU) == NULL ||
object_class_is_abstract(oc))) {
return NULL;
}
return oc;
Expand Down

0 comments on commit cae8506

Please sign in to comment.