aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2006-12-17 19:00:46 +0100
committerTobias Burnus <burnus@gcc.gnu.org>2006-12-17 19:00:46 +0100
commit2ef73bb4ef051fdcf5e186465fa9bf4f7933f8f3 (patch)
tree39f2b7d7bf77d42ba808797fd8bbb1632d14e054
parent23f351630bf38802005b873256d744c68c39a8ce (diff)
downloadgcc-2ef73bb4ef051fdcf5e186465fa9bf4f7933f8f3.zip
gcc-2ef73bb4ef051fdcf5e186465fa9bf4f7933f8f3.tar.gz
gcc-2ef73bb4ef051fdcf5e186465fa9bf4f7933f8f3.tar.bz2
associated.c: Check for associated(NULL,NULL).
2006-12-17 Tobias Burnus <burnus@net-b.de> * intrinsics/associated.c: Check for associated(NULL,NULL). 2006-12-17 Tobias Burnus <burnus@net-b.de> * gfortran.dg/associated_2.f90: Add test for associated(NULL,NULL). From-SVN: r119989
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gfortran.dg/associated_2.f902
-rw-r--r--libgfortran/ChangeLog4
-rw-r--r--libgfortran/intrinsics/associated.c2
4 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 6d8074e..39abc50 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2006-12-17 Tobias Burnus <burnus@net-b.de>
+
+ * gfortran.dg/associated_2.f90: Add test for associated(NULL,NULL).
+
2006-12-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR middle-end/7651
diff --git a/gcc/testsuite/gfortran.dg/associated_2.f90 b/gcc/testsuite/gfortran.dg/associated_2.f90
index 5b8b689..1ff8006 100644
--- a/gcc/testsuite/gfortran.dg/associated_2.f90
+++ b/gcc/testsuite/gfortran.dg/associated_2.f90
@@ -17,6 +17,8 @@ contains
! the target argument is not present (case (i))
if (.not. associated (b)) call abort ()
deallocate (a)
+ nullify(a)
+ if(associated(a,a)) call abort()
allocate (a(2,1,2))
b => a
if (.not.associated (b)) call abort ()
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 0844d1a..ff7adbe 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,7 @@
+2006-12-17 Tobias Burnus <burnus@net-b.de>
+
+ * intrinsics/associated.c: Check for associated(NULL,NULL).
+
2006-12-15 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/30145
diff --git a/libgfortran/intrinsics/associated.c b/libgfortran/intrinsics/associated.c
index 1a05f20..d5ef556 100644
--- a/libgfortran/intrinsics/associated.c
+++ b/libgfortran/intrinsics/associated.c
@@ -39,6 +39,8 @@ associated (const gfc_array_void *pointer, const gfc_array_void *target)
{
int n, rank;
+ if (GFC_DESCRIPTOR_DATA (pointer) == NULL)
+ return 0;
if (GFC_DESCRIPTOR_DATA (pointer) != GFC_DESCRIPTOR_DATA (target))
return 0;
if (GFC_DESCRIPTOR_DTYPE (pointer) != GFC_DESCRIPTOR_DTYPE (target))