This is an archive of the discontinued LLVM Phabricator instance.

[flang] Avoid crash in lowering for unlimited polymorphic function return
ClosedPublic

Authored by clementval on Nov 25 2022, 1:07 AM.

Details

Summary

The dynamic type of an unlimited polymorphic entity has the
derived category but does not have derived type spec. This leads
to a crash for a nullptr dereference. This patch avoids this crash
by checking if that the dynamic type is not unlimited polymorphic
before dereferencing the derived type spec.

Diff Detail

Event Timeline

clementval created this revision.Nov 25 2022, 1:07 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptNov 25 2022, 1:07 AM
Herald added a subscriber: mehdi_amini. · View Herald Transcript
clementval requested review of this revision.Nov 25 2022, 1:07 AM
clementval retitled this revision from [flang] Avoid crash in lowerinf for unliminted polymorphic fct return to [flang] Avoid crash in lowering for unlimited polymorphic function return.Nov 25 2022, 1:14 AM
PeteSteinfeld accepted this revision.Nov 25 2022, 4:43 AM

All builds and tests correctly and looks good.

This revision is now accepted and ready to land.Nov 25 2022, 4:43 AM