mirror of
https://github.com/qemu/qemu.git
synced 2024-11-25 11:53:39 +08:00
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>
This commit is contained in:
parent
5900d6b2d5
commit
0e44a02301
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user