]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
associated.c: Check for associated(NULL,NULL).
authorTobias Burnus <burnus@net-b.de>
Sun, 17 Dec 2006 18:00:46 +0000 (19:00 +0100)
committerTobias Burnus <burnus@gcc.gnu.org>
Sun, 17 Dec 2006 18:00:46 +0000 (19:00 +0100)
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

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/associated_2.f90
libgfortran/ChangeLog
libgfortran/intrinsics/associated.c

index 6d8074e2fc8ad05aa343639f7f57bcda88e768a3..39abc504ee740993c3c2af78d13e21cba999290d 100644 (file)
@@ -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
index 5b8b689d1f4b6271440f2af6e1185260dac4a71d..1ff8006de009824c5f60543f6b64510ef5cd7745 100644 (file)
@@ -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 ()
index 0844d1a6df7c1c290e9b7b1ff978157c8bde586a..ff7adbe2da655dd225927fcff0ef61e8a0bc011a 100644 (file)
@@ -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
index 1a05f20072bca00146e4330919dc1f46ae742ba9..d5ef556b80cff154b5afebe36c3cf04f463a41d2 100644 (file)
@@ -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))