This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Dealing with output of clang --analyze


>             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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]