This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [patch] tree-ssa-dom.c: Use VEC(vrp_element_p,heap) instead ofVARRAY.


On Tue, 2005-05-03 at 16:31 -0400, Kazu Hirata wrote:
> Hi Jeff,
> 
> > This doesn't look right to me.  If you read the comments earlier in the
> > code it states that two tests must be performed.  First you have to
> > verify the existance of the varray (or VEC) then you have to look at
> > the number of active entries.
> > 
> > Your change will cause a segfault in the first case as *vrp_records
> > would be dereferencing a null pointer.
> > 
> > So my question to you would be is there some reason why it's no longer
> > possible for vrp_records to be null?
> 
> *vrp_records may be NULL, but VEC_length (vrp_element_p, NULL)
> evaluates to 0 because VEC_length is implemented as
You're misunderstanding me.  I'm referring to vrp_records being null,
not *vrp_records.

If vrp_records is null, then *vrp_records is going to segfault.

Jeff


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