From 756d334463a8c8490ff9d1af2c9e636420a28a28 Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 3 Oct 2001 22:23:14 +0000 Subject: [PATCH] oops, invalid downcasts --- dtool/src/interrogate/interfaceMaker.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dtool/src/interrogate/interfaceMaker.cxx b/dtool/src/interrogate/interfaceMaker.cxx index 811fb37f02..7efee037a3 100644 --- a/dtool/src/interrogate/interfaceMaker.cxx +++ b/dtool/src/interrogate/interfaceMaker.cxx @@ -581,7 +581,10 @@ record_object(TypeIndex type_index) { record_function(itype, itype.derivation_get_upcast(di)); } if (itype.derivation_has_downcast(di)) { - record_function(itype, itype.derivation_get_downcast(di)); + // Downcasts are methods of the base class, not the child class. + TypeIndex base_type_index = itype.get_derivation(di); + const InterrogateType &base_type = idb->get_type(base_type_index); + record_function(base_type, itype.derivation_get_downcast(di)); } }