]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgfortran/intrinsics/extends_type_of.c
array.c (resolve_array_list): Apply C4106.
[thirdparty/gcc.git] / libgfortran / intrinsics / extends_type_of.c
index 223423428d572817e8f81622d3113c3a8dc50de6..8f8b5a9f7d1978ee996013429bc6239079b09d05 100644 (file)
@@ -49,6 +49,14 @@ export_proto(is_extension_of);
 GFC_LOGICAL_4
 is_extension_of (struct vtype *v1, struct vtype *v2)
 {
+  /* Assume that only unlimited polymorphic entities will pass NULL v1 or v2
+     if they are unallocated or disassociated.  */
+
+  if (!v2)
+    return 1;
+  if (!v1)
+    return 0;
+
   while (v1)
     {
       if (v1->hash == v2->hash) return 1;