]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: Fix segmentation fault in defined assignment [PR109066]
authorPaul Thomas <pault@gcc.gnu.org>
Sat, 16 Nov 2024 15:56:10 +0000 (15:56 +0000)
committerPaul Thomas <pault@gcc.gnu.org>
Sat, 16 Nov 2024 15:56:38 +0000 (15:56 +0000)
commit27ff8049bbdb0a001ba46835cd6a334c4ac76573
tree65d6bf9096d4c88666ffe20ab84af5fadb7297af
parent4a4bd60fa08b9e1079ebead6cb8c3ce82c7f9ef6
Fortran: Fix segmentation fault in defined assignment [PR109066]

2024-11-16  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/109066
* resolve.cc (generate_component_assignments): If the temporary
for 'var' is a pointer and 'expr' is neither a constant or
a variable, change its attribute from pointer to allocatable.
This avoids assignment to a temporary point that has neither
been allocated or associated.

gcc/testsuite/
PR fortran/109066
* gfortran.dg/defined_assignment_12.f90: New test.
gcc/fortran/resolve.cc
gcc/testsuite/gfortran.dg/defined_assignment_12.f90 [new file with mode: 0644]