diff --git a/FWCore/Utilities/src/TypeWithDict.cc b/FWCore/Utilities/src/TypeWithDict.cc index 86f71aaeb4df8..7efdee0362924 100644 --- a/FWCore/Utilities/src/TypeWithDict.cc +++ b/FWCore/Utilities/src/TypeWithDict.cc @@ -524,7 +524,7 @@ const void* TypeWithDict:: pointerToBaseType(const void* ptr, const TypeWithDict& derivedType) const { - if (this == &derivedType) { + if (this->ti_ == derivedType.ti_ || *this->ti_ == *derivedType.ti_) { return ptr; } int offset = derivedType.getBaseClassOffset(*this);