From f72d4b774a268b7ff630bfed96698cae18464d21 Mon Sep 17 00:00:00 2001 From: Pierre Muller Date: Mon, 8 Mar 2010 16:55:17 +0000 Subject: [PATCH] * p-lang.c (is_pascal_string_type): Check that TYPE arg is non NULL. --- gdb/ChangeLog | 4 ++++ gdb/p-lang.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1abc0df5712..2a603762473 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2020-03-08 Pierre Muller + + * p-lang.c (is_pascal_string_type): Check that TYPE arg is non NULL. + 2010-03-08 Jan Kratochvil Hui Zhu diff --git a/gdb/p-lang.c b/gdb/p-lang.c index c768d1bec3d..0db99a4aa92 100644 --- a/gdb/p-lang.c +++ b/gdb/p-lang.c @@ -101,7 +101,7 @@ is_pascal_string_type (struct type *type,int *length_pos, struct type **char_type, char **arrayname) { - if (TYPE_CODE (type) == TYPE_CODE_STRUCT) + if ((type != NULL) && (TYPE_CODE (type) == TYPE_CODE_STRUCT)) { /* Old Borland type pascal strings from Free Pascal Compiler. */ /* Two fields: length and st. */ -- 2.30.2