[flang] Warn on mismatched DATA substring sizes rather than crashing
authorPeter Klausler <pklausler@nvidia.com>
Tue, 7 Feb 2023 00:40:21 +0000 (16:40 -0800)
committerPeter Klausler <pklausler@nvidia.com>
Mon, 13 Feb 2023 20:31:05 +0000 (12:31 -0800)
commit2dab5bdf89f6e62e48b6b8364abae0c8e6c2fa0c
tree63ac4b64f65586bed2d152f8270cc7a9d86da7d5
parent9369b7d307be0aa1cf430203f2d5f1f71a7a04b8
[flang] Warn on mismatched DATA substring sizes rather than crashing

When a DATA statement initializes a substring with a character constant
of the wrong length, do the right thing with blank padding or truncation,
and emit a warning.  Current code is crashing due to an unhandled error
reported from the low-level data image initialization framework.

Differential Revision: https://reviews.llvm.org/D143819
flang/include/flang/Evaluate/initial-image.h
flang/lib/Semantics/data-to-inits.cpp
flang/test/Semantics/data17.f90 [new file with mode: 0644]