From 03b4bca2d7c342aecb50a5874837aa4ef750460a Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Sat, 4 Aug 2007 02:50:16 +0000 Subject: [PATCH] 2007-08-03 Michael Snyder * jv-lang.c (java_link_class_type): Guard against NULL. --- gdb/ChangeLog | 4 ++++ gdb/jv-lang.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5aaee7ab160..b8162736bad 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2007-08-03 Michael Snyder + + * jv-lang.c (java_link_class_type): Guard against NULL. + 2007-08-02 Michael Snyder * gdbtypes.c (create_set_type): Test should only be done within diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c index fb2b419d191..bed3487bad8 100644 --- a/gdb/jv-lang.c +++ b/gdb/jv-lang.c @@ -39,6 +39,7 @@ #include "demangle.h" #include "dictionary.h" #include +#include "gdb_assert.h" struct type *java_int_type; struct type *java_byte_type; @@ -351,13 +352,14 @@ java_link_class_type (struct type *type, struct value *clas) struct objfile *objfile = get_dynamics_objfile (); struct type *tsuper; + gdb_assert (name != NULL); unqualified_name = strrchr (name, '.'); if (unqualified_name == NULL) unqualified_name = name; temp = clas; temp = value_struct_elt (&temp, NULL, "superclass", NULL, "structure"); - if (name != NULL && strcmp (name, "java.lang.Object") == 0) + if (strcmp (name, "java.lang.Object") == 0) { tsuper = get_java_object_type (); if (tsuper && TYPE_CODE (tsuper) == TYPE_CODE_PTR) -- 2.30.2