From 0e44a02301b081d36e686e767694a770c25160a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Mon, 21 Jan 2013 17:27:54 +0100 Subject: target-alpha: Detect attempt to instantiate non-CPU type in cpu_init() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- target-alpha/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'target-alpha') 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; } -- cgit v1.2.3