]> git.ipfire.org Git - thirdparty/qemu.git/commit
qom: dynamic_cast of NULL is always NULL
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 23 Nov 2012 15:56:17 +0000 (16:56 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Mon, 3 Dec 2012 20:26:56 +0000 (14:26 -0600)
commit5e19e498b4b2a31c985dc96b1aff078c34e40488
tree7ddb202ba14ef6766556cf03eb30d42bcd1773d9
parent4fb9656b9d62ce348656a7184ac7861d70c490a7
qom: dynamic_cast of NULL is always NULL

Trying to cast a NULL value will cause a crash.  Returning
NULL is also sensible, and it is also what the type-unsafe
DO_UPCAST macro does.

Reported-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit b7f43fe46029d8fd0594cd599fa2599dcce0f553)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
qom/object.c