aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-01-21 17:27:54 +0100
committerAndreas Färber <afaerber@suse.de>2013-01-27 14:52:05 +0100
commit0e44a02301b081d36e686e767694a770c25160a2 (patch)
tree31435777684a19a6244969484e4fe1fcda2a8624
parent5900d6b2d59875c9b11e4d8cead6d9ddaa9eb787 (diff)
target-alpha: Detect attempt to instantiate non-CPU type in cpu_init()
Check in alpha_cpu_class_by_name() whether the type found is actually (a sub-type of) TYPE_ALPHA_CPU. This fixes, e.g., -cpu typhoon-pcihost asserting. Signed-off-by: Andreas Färber <afaerber@suse.de>
-rw-r--r--target-alpha/cpu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/target-alpha/cpu.c b/target-alpha/cpu.c
index 3ac0fde2cd..0d6975ea9b 100644
--- a/target-alpha/cpu.c
+++ b/target-alpha/cpu.c
@@ -96,7 +96,7 @@ static ObjectClass *alpha_cpu_class_by_name(const char *cpu_model)
}
oc = object_class_by_name(cpu_model);
- if (oc != NULL) {
+ if (oc != NULL && object_class_dynamic_cast(oc, TYPE_ALPHA_CPU) != NULL) {
return oc;
}