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,fix, PING] PR21875 Internal Array IO and NIST final fix


On Wed, Sep 14, 2005 at 07:33:55AM -0700, Jerry DeLisle wrote:
> Steven B. wrote.
> >
> >The only surprising bit is this:
> >+   if (*len < 0)  /* This should never happen */
> >+     *len = 0;
> >+ 
> >So if it never happens, why have it?
> 
> I put that in there to flag out an issue in review (which it has).  There 
> was a point where len was actually going negative and causing a segfault.  
> I put that there to catch that condition long enough for me to see what was 
> happening to fix it.
> 
> Its sort of a policy question.  Leaving it may prevent a future segfault if 
> something starts going wrong again.  It would allow us to see bad output 
> rather than a segfault.  Other than that, there is no need.  I will take it 
> out.
> 

If you think that further work on gfortran may
accidently lead to a situation of len < 0, then
you can change it to gcc_assert(*len >= 0).

-- 
Steve


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