This is an archive of the discontinued LLVM Phabricator instance.

[flang][runtime] Initialize uninitialized pointer components
ClosedPublic

Authored by klausler on May 5 2023, 12:16 PM.

Details

Summary

Pointer components without default initialization pose some
difficult (or impossible) problems when they appear as right-hand
side targets in pointer assignment statements; they may contain
garbage or stale data that looks enough like a valid descriptor
to cause a crash. Solve the problem by avoiding it -- ensure
that pointers' descriptors are at least minimally established.

Diff Detail

Event Timeline

klausler created this revision.May 5 2023, 12:16 PM
Herald added a project: Restricted Project. · View Herald Transcript
klausler requested review of this revision.May 5 2023, 12:16 PM
vzakhari accepted this revision.May 5 2023, 12:45 PM

LGTM! Do we need to highlight the default initialization in the docs?

This revision is now accepted and ready to land.May 5 2023, 12:45 PM

LGTM! Do we need to highlight the default initialization in the docs?

No. We're doing this as an implementation convenience, not as a guaranteed feature upon which users may rely, and we could happily rescind it if a better technique were to be discovered.

LGTM! Do we need to highlight the default initialization in the docs?

No. We're doing this as an implementation convenience, not as a guaranteed feature upon which users may rely, and we could happily rescind it if a better technique were to be discovered.

OK. Thanks!

This revision was landed with ongoing or failed builds.May 8 2023, 3:25 PM
This revision was automatically updated to reflect the committed changes.
flang/test/Semantics/canondo01.f90