[Bug fortran/57965] [F03] Allocation of derived type containing an allocatable character component segfaults
anlauf at gmx dot de
gcc-bugzilla@gcc.gnu.org
Sat Nov 26 00:27:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57965
Harald Anlauf <anlauf at gmx dot de> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |anlauf at gmx dot de
--- Comment #3 from Harald Anlauf <anlauf at gmx dot de> ---
The dump tree of the allocation looks strange:
a = (struct mytype *) __builtin_malloc (4);
...
{
struct mytype mytype.0;
__builtin_memmove ((void *) mytype.0.str_value, (void *) &0B, 1);
__builtin_memset ((void *) mytype.0.str_value + 1, 32, 41);
*a = mytype.0;
}
Instead of setting the string's first character to zero,
the memmove appears to access a null pointer.
Or am I missing something?
More information about the Gcc-bugs
mailing list