diff options
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 5 | ||||
-rw-r--r-- | libgfortran/intrinsics/extends_type_of.c | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index ecaa6e3..bea7c72 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,8 @@ +2012-12-19 Paul Thomas <pault@gcc.gnu.org> + + * intrinsics/extends_type_of.c : Return correct results for + null vptrs. + 2012-12-03 Janus Weil <janus@gcc.gnu.org> PR fortran/55548 diff --git a/libgfortran/intrinsics/extends_type_of.c b/libgfortran/intrinsics/extends_type_of.c index 2234234..8f8b5a9 100644 --- a/libgfortran/intrinsics/extends_type_of.c +++ b/libgfortran/intrinsics/extends_type_of.c @@ -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; |