[patch,fix, PING] PR21875 Internal Array IO and NIST final fix
Jerry DeLisle
jvdelisle@verizon.net
Wed Sep 14 15:10:00 GMT 2005
Steve Kargl wrote:
> 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, thanks for pointing this out. It fits the situation well.
I like this better than a comment. I will run a few tests here with gcc_assert
and then close on this.
Jerry
More information about the Fortran
mailing list