+2009-12-06 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41478
+ PR fortran/42268
+ * gfortran.dg/intrinsic_pack_5.f90: New test.
+
2009-12-04 Jason Merrill <jason@redhat.com>
PR c++/42010
--- /dev/null
+! { dg-do run }
+!
+! PR 41478: Corrupted memory using PACK for derived-types with allocated components
+! PR 42268: [4.4/4.5 Regression] derived type segfault with pack
+!
+! Original test case by Juergen Reuter <reuter@physik.uni-freiburg.de>
+! Modified by Janus Weil <janus@gcc.gnu.org>
+
+type :: container_t
+ integer:: entry = -1
+end type container_t
+type(container_t), dimension(1) :: a1, a2
+a2(1)%entry = 1
+a1 = pack (a2, mask = [.true.])
+if (a1(1)%entry/=1) call abort()
+end
+2009-12-06 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41478
+ PR fortran/42268
+ * intrinsics/pack_generic.c (pack): Add safety checks for the case that
+ 'vector' is NULL.
+
2009-12-05 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* Makefile.in: Regenerate.
case GFC_DTYPE_DERIVED_2:
if (GFC_UNALIGNED_2(ret->data) || GFC_UNALIGNED_2(array->data)
- || GFC_UNALIGNED_2(vector->data))
+ || (vector && GFC_UNALIGNED_2(vector->data)))
break;
else
{
case GFC_DTYPE_DERIVED_4:
if (GFC_UNALIGNED_4(ret->data) || GFC_UNALIGNED_4(array->data)
- || GFC_UNALIGNED_4(vector->data))
+ || (vector && GFC_UNALIGNED_4(vector->data)))
break;
else
{
case GFC_DTYPE_DERIVED_8:
if (GFC_UNALIGNED_8(ret->data) || GFC_UNALIGNED_8(array->data)
- || GFC_UNALIGNED_8(vector->data))
+ || (vector && GFC_UNALIGNED_8(vector->data)))
break;
else
{
#ifdef HAVE_GFC_INTEGER_16
case GFC_DTYPE_DERIVED_16:
if (GFC_UNALIGNED_16(ret->data) || GFC_UNALIGNED_16(array->data)
- || GFC_UNALIGNED_16(vector->data))
+ || (vector && GFC_UNALIGNED_16(vector->data)))
break;
else
{