diff options
author | Andreas Färber <afaerber@suse.de> | 2013-01-21 17:27:54 +0100 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2013-01-27 14:52:05 +0100 |
commit | 0e44a02301b081d36e686e767694a770c25160a2 (patch) | |
tree | 31435777684a19a6244969484e4fe1fcda2a8624 /target-alpha | |
parent | 5900d6b2d59875c9b11e4d8cead6d9ddaa9eb787 (diff) | |
download | qemu-0e44a02301b081d36e686e767694a770c25160a2.zip qemu-0e44a02301b081d36e686e767694a770c25160a2.tar.gz qemu-0e44a02301b081d36e686e767694a770c25160a2.tar.bz2 |
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>
Diffstat (limited to 'target-alpha')
-rw-r--r-- | target-alpha/cpu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/target-alpha/cpu.c b/target-alpha/cpu.c index 3ac0fde..0d6975e 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; } |