This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Dealing with output of clang --analyze
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Holger Freyther <zecke at selfish dot org>
- Cc: gdb at sources dot redhat dot com
- Date: Sun, 14 Mar 2010 09:43:49 -0700
- Subject: Re: Dealing with output of clang --analyze
- References: <loom.20100314T044842-433@post.gmane.org>
> struct type *type = value_type (called_method);
> if (type && TYPE_CODE (type) == TYPE_CODE_PTR)
> type = TYPE_TARGET_TYPE (type);
> type = TYPE_TARGET_TYPE (type);
>
> In the case where value_type(called_method) returns NULL, the
> if is not executed and the second TYPE_TARGET_TYPE will do a
> NULL pointer dereference. There are at least 66 of these cases
> in the source. Is it worth addressing them?
In the particular example you chose, I do not think that there is
a problem, because called_method should always have a type. Not
sure about the others, we'd have to look at them individually,
I guess.
--
Joel