aboutsummaryrefslogtreecommitdiff
path: root/target-unicore32
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-01-23 12:41:38 +0100
committerAndreas Färber <afaerber@suse.de>2013-01-28 16:57:56 +0100
commit4933908ac5974252c1830d69e9493fa79c5ea606 (patch)
tree1dab7b1b9b9a108ca275f60fb1f0e3b2c602afb1 /target-unicore32
parentc432b7840cfbc35fc0d097428d0a2f2a94983360 (diff)
target-unicore32: Catch attempt to instantiate abstract type in cpu_init()
Fixes -cpu unicore32-cpu asserting. Cc: qemu-stable@nongnu.org Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-unicore32')
-rw-r--r--target-unicore32/cpu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/target-unicore32/cpu.c b/target-unicore32/cpu.c
index 9239d49511..6735b253c2 100644
--- a/target-unicore32/cpu.c
+++ b/target-unicore32/cpu.c
@@ -31,7 +31,8 @@ static ObjectClass *uc32_cpu_class_by_name(const char *cpu_model)
}
oc = object_class_by_name(cpu_model);
- if (oc != NULL && !object_class_dynamic_cast(oc, TYPE_UNICORE32_CPU)) {
+ if (oc != NULL && (!object_class_dynamic_cast(oc, TYPE_UNICORE32_CPU) ||
+ object_class_is_abstract(oc))) {
oc = NULL;
}
return oc;