[flang] Avoid null pointer dereference

Original-commit: flang-compiler/f18@3c108c0edc
Reviewed-on: https://github.com/flang-compiler/f18/pull/553
Tree-same-pre-rewrite: false
This commit is contained in:
peter klausler 2019-07-03 15:16:36 -07:00
parent 6b8df08cad
commit d1de4fe462
1 changed files with 1 additions and 1 deletions

View File

@ -174,7 +174,7 @@ bool DynamicType::IsTkCompatibleWith(const DynamicType &that) const {
} else if (!derived_ || !that.derived_ ||
!IsKindCompatible(*derived_, *that.derived_)) {
return false; // kind params don't match
} else if (!IsPolymorphic()) {
} else if (!IsPolymorphic() && that.derived_ != nullptr) {
return derived_->typeSymbol() == that.derived_->typeSymbol();
} else {
return IsAncestorTypeOf(derived_, that.derived_);