This is an archive of the discontinued LLVM Phabricator instance.

[flang] Handle correctly optional intrinsic scalar to unlimited polymorphic optional
ClosedPublic

Authored by clementval on Feb 13 2023, 1:37 AM.

Details

Summary

When an optional intrinsic scalar is passed to a function expecting an
unlimited polymorphic dummy argument, the presence test must be done
before the emboxing otherwise it will result in a program crash.

Depends on D143888

Diff Detail

Event Timeline

clementval created this revision.Feb 13 2023, 1:37 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptFeb 13 2023, 1:37 AM
clementval requested review of this revision.Feb 13 2023, 1:37 AM
This revision is now accepted and ready to land.Feb 13 2023, 2:26 AM
PeteSteinfeld accepted this revision.Feb 13 2023, 3:54 AM

Aside from the nit in the comment, all builds and tests correctly and looks good.

flang/lib/Lower/ConvertExpr.cpp
2665

"opional" should be "optional".

clementval marked an inline comment as done.Feb 13 2023, 6:44 AM