Hi Jerry!
Am 11.09.25 um 21:30 schrieb Jerry D:
On 9/11/25 11:28 AM, Harald Anlauf wrote:
Dear all,
here's a - once found - seemingly simple and obvious fix for a memory
corruption happening when intrinsic assignment is used to set a scalar
allocatable polymorphic component of a derived type when the latter
is instanciated as an array of rank > 0. Just get the dimension
attribute right when using gfc_variable_attr ...
The testcase is an extended version of the reporter's with unlimited
polymorphism, including another simpler one contributed by a friend.
Without the fix, both tests crash with memory corruption of various
kinds.
Regtested on x86_64-pc-linux-gnu. OK for mainline?
If there are no objections, I would like to backport to at least
15-branch.
Thanks,
Harald
OK and backport, very simple.
Thanks for the review!
Pushed as r16-3813-g0899b826f7196f.
I wonder how many more cases we have in the frontend where walking
a reference chain misses similar simple things...
Harald
Jerry